J has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/63862


Change subject: use shrink instead of im_shrink
......................................................................

use shrink instead of im_shrink

shrink is more efficient with recent versions of vips while im_shrink
still uses more resources.

Change-Id: Id8256138770aff8ecb3aa873012e0ccd0564c768
---
M VipsScaler_body.php
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VipsScaler 
refs/changes/62/63862/1

diff --git a/VipsScaler_body.php b/VipsScaler_body.php
index 69f31b1..e533893 100644
--- a/VipsScaler_body.php
+++ b/VipsScaler_body.php
@@ -153,7 +153,7 @@
                                $rx, $ry
                        ));
 
-                       $commands[] = new VipsCommand( $wgVipsCommand, array( 
'im_shrink', $rx, $ry ) );
+                       $commands[] = new VipsCommand( $wgVipsCommand, array( 
'shrink', $rx, $ry ) );
                } else {
                        if ( $rotation % 180 == 90 ) {
                                $dstWidth = $params['physicalHeight'];
@@ -187,7 +187,6 @@
                if ( $rotation % 360 != 0 && $rotation % 90 == 0 ) {
                        $commands[] = new VipsCommand( $wgVipsCommand, array( 
"im_rot{$rotation}" ) );
                }
-
                return $commands;
        }
 
@@ -421,6 +420,9 @@
                $this->err = wfShellExec( $cmd, $retval, $env, $limits );
 
                # Cleanup temp file
+               if ( $retval != 0 && file_exists( $this->ouptut ) ) {
+                       unlink ( $this->output );
+               }
                if ( $this->removeInput ) {
                        unlink( $this->input );
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/63862
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8256138770aff8ecb3aa873012e0ccd0564c768
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VipsScaler
Gerrit-Branch: master
Gerrit-Owner: J <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to