Index: trunk/extensions/VipsScaler/VipsScaler_body.php |
— | — | @@ -48,10 +48,18 @@ |
49 | 49 | # Set the new rotated file |
50 | 50 | $tmp = $tmp2; |
51 | 51 | } |
| 52 | + if ( $rotation % 180 == 90 ) { |
| 53 | + # Rotated 90 degrees, so width = height and vice versa |
| 54 | + $rx = $params['srcWidth'] / $params['physicalHeight']; |
| 55 | + $ry = $params['srcHeight'] / $params['physicalWidth']; |
| 56 | + } else { |
| 57 | + $rx = $params['srcWidth'] / $params['physicalWidth']; |
| 58 | + $ry = $params['srcHeight'] / $params['physicalHeight']; |
| 59 | + } |
52 | 60 | |
53 | 61 | # Scale the image to the final output |
54 | | - list( $err, $retval ) = self::vips( 'im_resize_linear', $tmp, |
55 | | - $params['dstPath'], $params['physicalWidth'], $params['physicalHeight'] ); |
| 62 | + list( $err, $retval ) = self::vips( 'im_shrink', $tmp, |
| 63 | + $params['dstPath'], $rx, $ry ); |
56 | 64 | # Remove the temp file |
57 | 65 | unlink( $tmp ); |
58 | 66 | if ( $retval != 0 ) { |