I was to make PagedTiffHandler subclass TransformationalImageHandler.
The biggest thing that's different is the pool counter call.
However, given that a file is just as expensive in terms of
network bandwidth regardless of its type, seems to make sense
to make this check generic.
Change-Id: I7e4a4769edaa4742803df407b9c719c54fb77de3
}
}
+ // Thumbnailing a very large file could result in network saturation if
+ // everyone does it at once.
+ if ( $this->getSize() >= 1e7 ) { // 10MB
+ $that = $this;
+ $work = new PoolCounterWorkViaCallback( 'GetLocalFileCopy', sha1( $this->getName() ),
+ array(
+ 'doWork' => function() use ( $that ) {
+ return $that->getLocalRefPath();
+ }
+ )
+ );
+ $srcPath = $work->execute();
+ } else {
+ $srcPath = $this->getLocalRefPath();
+ }
+
// Original file
return array(
- 'path' => $this->getLocalRefPath(),
+ 'path' => $srcPath,
'width' => $this->getWidth(),
'height' => $this->getHeight()
);