Index: branches/wmf/1.16wmf3/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 | |
— | — | @@ -121,7 +123,7 @@ |
122 | 124 | } elseif ( $mimeType == 'image/png' ) { |
123 | 125 | $quality = "-quality 95"; // zlib 9, adaptive filtering |
124 | 126 | } elseif( $mimeType == 'image/gif' ) { |
125 | | - if( $srcWidth * $srcHeight > $wgMaxAnimatedGifArea ) { |
| 127 | + if( $this->getImageArea( $image, $srcWidth, $srcHeight ) > $wgMaxAnimatedGifArea ) { |
126 | 128 | // Extract initial frame only; we're so big it'll |
127 | 129 | // be a total drag. :P |
128 | 130 | $frame = '[0]'; |
Property changes on: branches/wmf/1.16wmf3/includes/media/Bitmap.php |
___________________________________________________________________ |
Name: svn:mergeinfo |
129 | 131 | + /branches/REL1_15/phase3/includes/media/Bitmap.php:51646 |
/branches/wmf-deployment/includes/media/Bitmap.php:53381 |
/trunk/phase3/includes/media/Bitmap.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57530,57541,57602,57916,58151,58219,58633,58816,59718,60704,60760,61189,61557,64691-64692 |
Index: branches/wmf/1.16wmf3/includes/DefaultSettings.php |
— | — | @@ -2249,11 +2249,11 @@ |
2250 | 2250 | $wgMaxImageArea = 1.25e7; |
2251 | 2251 | /** |
2252 | 2252 | * Force thumbnailing of animated GIFs above this size to a single |
2253 | | - * frame instead of an animated thumbnail. ImageMagick seems to |
2254 | | - * get real unhappy and doesn't play well with resource limits. :P |
2255 | | - * Defaulting to 1 megapixel (1000x1000) |
| 2253 | + * frame instead of an animated thumbnail. As of MW 1.17 this limit |
| 2254 | + * is checked against the total size of all frames in the animation. |
| 2255 | + * It probably makes sense to keep this equal to $wgMaxImageArea. |
2256 | 2256 | */ |
2257 | | -$wgMaxAnimatedGifArea = 1.0e6; |
| 2257 | +$wgMaxAnimatedGifArea = 1.25e7; |
2258 | 2258 | /** |
2259 | 2259 | * Browsers don't support TIFF inline generally... |
2260 | 2260 | * For inline display, we need to convert to PNG or JPEG. |
Property changes on: branches/wmf/1.16wmf3/includes/DefaultSettings.php |
___________________________________________________________________ |
Name: svn:mergeinfo |
2261 | 2261 | - /branches/REL1_15/phase3/includes/DefaultSettings.php:51646 |
/branches/wmf-deployment/includes/DefaultSettings.php:53381 |
/trunk/phase3/includes/DefaultSettings.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57530,57541,57602,57916,58151,58219,58633,58816,59607,59680,59683,60704,61557,62486 |
2262 | 2262 | + /branches/REL1_15/phase3/includes/DefaultSettings.php:51646 |
/branches/wmf-deployment/includes/DefaultSettings.php:53381 |
/trunk/phase3/includes/DefaultSettings.php:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57530,57541,57602,57916,58151,58219,58633,58816,59607,59680,59683,60704,61557,62486,64692 |