Index: trunk/phase3/includes/media/Bitmap.php |
— | — | @@ -18,6 +18,18 @@ |
19 | 19 | $srcWidth = $image->getWidth( $params['page'] ); |
20 | 20 | $srcHeight = $image->getHeight( $params['page'] ); |
21 | 21 | |
| 22 | + # Don't make an image bigger than the source |
| 23 | + $params['physicalWidth'] = $params['width']; |
| 24 | + $params['physicalHeight'] = $params['height']; |
| 25 | + |
| 26 | + if ( $params['physicalWidth'] >= $srcWidth ) { |
| 27 | + $params['physicalWidth'] = $srcWidth; |
| 28 | + $params['physicalHeight'] = $srcHeight; |
| 29 | + # Skip scaling limit checks if no scaling is required |
| 30 | + if( !$image->mustRender() ) |
| 31 | + return true; |
| 32 | + } |
| 33 | + |
22 | 34 | # Don't thumbnail an image so big that it will fill hard drives and send servers into swap |
23 | 35 | # JPEG has the handy property of allowing thumbnailing without full decompression, so we make |
24 | 36 | # an exception for it. |
— | — | @@ -27,16 +39,6 @@ |
28 | 40 | return false; |
29 | 41 | } |
30 | 42 | |
31 | | - # Don't make an image bigger than the source |
32 | | - $params['physicalWidth'] = $params['width']; |
33 | | - $params['physicalHeight'] = $params['height']; |
34 | | - |
35 | | - if ( $params['physicalWidth'] >= $srcWidth ) { |
36 | | - $params['physicalWidth'] = $srcWidth; |
37 | | - $params['physicalHeight'] = $srcHeight; |
38 | | - return true; |
39 | | - } |
40 | | - |
41 | 43 | return true; |
42 | 44 | } |
43 | 45 | |