]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/img.pm
Merge branch 'ready/perf'
[git.ikiwiki.info.git] / IkiWiki / Plugin / img.pm
index b98e843d436b1aed68ca13a12da94ee44a74dd06..b92e24cc06fb93d8d88adcf1517903e46e49dc25 100644 (file)
@@ -118,7 +118,6 @@ sub preprocess (@) {
                                error sprintf(gettext("failed to read %s: %s"), $outfile, $r) if $r;
                        }
                        else {
-                               ($dwidth, $dheight)=($w, $h);
                                $r = $im->Resize(geometry => "${w}x${h}");
                                error sprintf(gettext("failed to resize: %s"), $r) if $r;
 
@@ -132,9 +131,10 @@ sub preprocess (@) {
                                        $imglink = $file;
                                }
                        }
-                       
-                       $dwidth = $im->Get("width") unless defined $dwidth;
-                       $dheight = $im->Get("height") unless defined $dheight;
+
+                       # always get the true size of the resized image
+                       $dwidth  = $im->Get("width"); 
+                       $dheight = $im->Get("height");
                }
        }
        else {