r84471 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84470‎ | r84471 | r84472 >
Date:18:40, 21 March 2011
Author:btongminh
Status:deferred
Tags:
Comment:
VipsHandler: Use im_shrink, which is PIO instead of WIO
Modified paths:
  • /trunk/extensions/VipsScaler/VipsScaler_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/VipsScaler/VipsScaler_body.php
@@ -48,10 +48,18 @@
4949 # Set the new rotated file
5050 $tmp = $tmp2;
5151 }
 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+ }
5260
5361 # 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 );
5664 # Remove the temp file
5765 unlink( $tmp );
5866 if ( $retval != 0 ) {

Status & tagging log