Replace wfRunHooks calls with direct Hooks::run calls
[lhc/web/wiklou.git] / includes / filerepo / file / File.php
index 7563d64..58311d3 100644 (file)
@@ -471,6 +471,8 @@ abstract class File {
        public function getThumbnailBucket( $desiredWidth, $page = 1 ) {
                global $wgThumbnailBuckets, $wgThumbnailMinimumBucketDistance;
 
+               wfDebugLog( 'thumbnail', 'thumbnail buckets ' . json_encode( $wgThumbnailBuckets ) );
+
                $imageWidth = $this->getWidth( $page );
 
                if ( $imageWidth === false ) {
@@ -490,7 +492,7 @@ abstract class File {
                sort( $sortedBuckets );
 
                foreach ( $sortedBuckets as $bucket ) {
-                       if ( $bucket > $imageWidth ) {
+                       if ( $bucket >= $imageWidth ) {
                                return false;
                        }
 
@@ -1123,7 +1125,7 @@ abstract class File {
                                $thumb = $this->transformErrorOutput( $thumbPath, $thumbUrl, $transformParams, $flags );
                        }
                        // Give extensions a chance to do something with this thumbnail...
-                       wfRunHooks( 'FileTransformed', array( $this, $thumb, $tmpThumbPath, $thumbPath ) );
+                       Hooks::run( 'FileTransformed', array( $this, $thumb, $tmpThumbPath, $thumbPath ) );
                }
 
                // Purge. Useful in the event of Core -> Squid connection failure or squid