summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/img.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-06-08 21:13:37 -0400
committerJoey Hess <joey@kitenet.net>2010-06-08 21:13:46 -0400
commit0ccf21daafa76fd182df5e6bc156f22873fe062d (patch)
treeaca6709dc5f1f4f3c6aed8ab9f8bf02001c6948f /IkiWiki/Plugin/img.pm
parenteff7fac985b41d038b071ab68cfe8bc0f428441b (diff)
img: Fill in missing height or width when scaling image.
Diffstat (limited to 'IkiWiki/Plugin/img.pm')
-rw-r--r--IkiWiki/Plugin/img.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm
index f06121578..63dfa9019 100644
--- a/IkiWiki/Plugin/img.pm
+++ b/IkiWiki/Plugin/img.pm
@@ -115,9 +115,6 @@ sub preprocess (@) {
$im = Image::Magick->new;
$r = $im->Read($outfile);
error sprintf(gettext("failed to read %s: %s"), $outfile, $r) if $r;
-
- $dwidth = $im->Get("width");
- $dheight = $im->Get("height");
}
else {
($dwidth, $dheight)=($w, $h);
@@ -133,6 +130,9 @@ sub preprocess (@) {
$imglink = $file;
}
}
+
+ $dwidth = $im->Get("width") unless defined $dwidth;
+ $dheight = $im->Get("height") unless defined $dheight;
}
}
else {