Index: branches/wmf/1.16wmf4/includes/media/Bitmap.php |
— | — | @@ -18,15 +18,6 @@ |
19 | 19 | $srcWidth = $image->getWidth( $params['page'] ); |
20 | 20 | $srcHeight = $image->getHeight( $params['page'] ); |
21 | 21 | |
22 | | - # Don't thumbnail an image so big that it will fill hard drives and send servers into swap |
23 | | - # JPEG has the handy property of allowing thumbnailing without full decompression, so we make |
24 | | - # an exception for it. |
25 | | - if ( $mimeType !== 'image/jpeg' && |
26 | | - $this->getImageArea( $image, $srcWidth, $srcHeight ) > $wgMaxImageArea ) |
27 | | - { |
28 | | - return false; |
29 | | - } |
30 | | - |
31 | 22 | # Don't make an image bigger than the source |
32 | 23 | $params['physicalWidth'] = $params['width']; |
33 | 24 | $params['physicalHeight'] = $params['height']; |
— | — | @@ -34,9 +25,20 @@ |
35 | 26 | if ( $params['physicalWidth'] >= $srcWidth ) { |
36 | 27 | $params['physicalWidth'] = $srcWidth; |
37 | 28 | $params['physicalHeight'] = $srcHeight; |
38 | | - return true; |
| 29 | + # Skip scaling limit checks if no scaling is required |
| 30 | + if( !$image->mustRender() ) |
| 31 | + return true; |
39 | 32 | } |
40 | 33 | |
| 34 | + # Don't thumbnail an image so big that it will fill hard drives and send servers into swap |
| 35 | + # JPEG has the handy property of allowing thumbnailing without full decompression, so we make |
| 36 | + # an exception for it. |
| 37 | + if ( $mimeType !== 'image/jpeg' && |
| 38 | + $srcWidth * $srcHeight > $wgMaxImageArea ) |
| 39 | + { |
| 40 | + return false; |
| 41 | + } |
| 42 | + |
41 | 43 | return true; |
42 | 44 | } |
43 | 45 | |
— | — | @@ -122,7 +124,7 @@ |
123 | 125 | } elseif ( $mimeType == 'image/png' ) { |
124 | 126 | $quality = "-quality 95"; // zlib 9, adaptive filtering |
125 | 127 | } elseif( $mimeType == 'image/gif' ) { |
126 | | - if( $srcWidth * $srcHeight > $wgMaxAnimatedGifArea ) { |
| 128 | + if( $this->getImageArea( $image, $srcWidth, $srcHeight ) > $wgMaxAnimatedGifArea ) { |
127 | 129 | // Extract initial frame only; we're so big it'll |
128 | 130 | // be a total drag. :P |
129 | 131 | $frame = '[0]'; |
Property changes on: branches/wmf/1.16wmf4/includes/media/Bitmap.php |
___________________________________________________________________ |
Name: svn:mergeinfo |
130 | 132 | + /branches/REL1_15/phase3/includes/media/Bitmap.php:51646 |
/branches/sqlite/includes/media/Bitmap.php:58211-58321 |
/branches/wmf-deployment/includes/media/Bitmap.php:53381,60970 |
/trunk/phase3/includes/media/Bitmap.php:63549,63764,63897-63901,64691-64692 |
Index: branches/wmf/1.16wmf4/includes/DefaultSettings.php |
— | — | @@ -2351,11 +2351,11 @@ |
2352 | 2352 | $wgMaxImageArea = 1.25e7; |
2353 | 2353 | /** |
2354 | 2354 | * Force thumbnailing of animated GIFs above this size to a single |
2355 | | - * frame instead of an animated thumbnail. ImageMagick seems to |
2356 | | - * get real unhappy and doesn't play well with resource limits. :P |
2357 | | - * Defaulting to 1 megapixel (1000x1000) |
| 2355 | + * frame instead of an animated thumbnail. As of MW 1.17 this limit |
| 2356 | + * is checked against the total size of all frames in the animation. |
| 2357 | + * It probably makes sense to keep this equal to $wgMaxImageArea. |
2358 | 2358 | */ |
2359 | | -$wgMaxAnimatedGifArea = 1.0e6; |
| 2359 | +$wgMaxAnimatedGifArea = 1.25e7; |
2360 | 2360 | /** |
2361 | 2361 | * Browsers don't support TIFF inline generally... |
2362 | 2362 | * For inline display, we need to convert to PNG or JPEG. |
Property changes on: branches/wmf/1.16wmf4/includes/DefaultSettings.php |
___________________________________________________________________ |
Name: svn:mergeinfo |
2363 | 2363 | + /branches/REL1_15/phase3/includes/DefaultSettings.php:51646 |
/branches/sqlite/includes/DefaultSettings.php:58211-58321 |
/branches/wmf-deployment/includes/DefaultSettings.php:53381,60970 |
/trunk/phase3/includes/DefaultSettings.php:63549,63764,63897-63901,64692 |