Fix for broken thumbnails when the file width is in $wgThumbnailBucket
authorGergő Tisza <tgr.huwiki@gmail.com>
Tue, 9 Dec 2014 01:55:49 +0000 (01:55 +0000)
committerGergő Tisza <gtisza@wikimedia.org>
Tue, 9 Dec 2014 02:25:25 +0000 (02:25 +0000)
When the source file width equals a bucket width,
File::getThumbnailBucket() suggests the use of a thumbnail of that
size. A thumbnailing attempt with the same width as the original
usually returns an error; File::generateBucketsIfNeeded() creates
an empty temporary file to later overwrite with the thumbnail, and
does not clean that file up on error. This empty file is then used
as the intermediary thumbnail for everything in the top bucket.

Bug: T77950
Change-Id: I8c2fdd9b51d227f34cac874ed2b16c87adc9315d

includes/filerepo/file/File.php

index c82be50..ae6b659 100644 (file)
@@ -492,7 +492,7 @@ abstract class File {
                sort( $sortedBuckets );
 
                foreach ( $sortedBuckets as $bucket ) {
-                       if ( $bucket > $imageWidth ) {
+                       if ( $bucket >= $imageWidth ) {
                                return false;
                        }