}
}
+ // 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()
);
* @return ThumbnailImage
*/
function iconThumb() {
- global $wgScriptPath, $IP;
- $assetsPath = "$wgScriptPath/assets/file-type-icons/";
- $assetsDirectory = "$IP/assets/file-type-icons/";
+ global $wgResourceBasePath, $IP;
+ $assetsPath = "$wgResourceBasePath/resources/assets/file-type-icons/";
+ $assetsDirectory = "$IP/resources/assets/file-type-icons/";
$try = array( 'fileicon-' . $this->getExtension() . '.png', 'fileicon.png' );
foreach ( $try as $icon ) {