sipb-www
/
ikiwiki.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
526a463
)
img: raise an error if we cannot find the image's size
author
Simon McVittie
<smcv@debian.org>
Tue, 16 Sep 2014 08:37:41 +0000
(09:37 +0100)
committer
Simon McVittie
<smcv@debian.org>
Tue, 16 Sep 2014 09:00:40 +0000
(10:00 +0100)
This happens for PDFs without ghostscript installed, for instance.
IkiWiki/Plugin/img.pm
patch
|
blob
|
history
diff --git
a/IkiWiki/Plugin/img.pm
b/IkiWiki/Plugin/img.pm
index 54c13d06919e0858442758d8fec09eb34bf0f0c3..17a58ca7a476b9b01e953d5ce10ce6c3200f8e7b 100644
(file)
--- a/
IkiWiki/Plugin/img.pm
+++ b/
IkiWiki/Plugin/img.pm
@@
-78,7
+78,11
@@
sub preprocess (@) {
my $imgdatalink;
my $r = $im->Read("$srcfile\[$pagenumber]");
error sprintf(gettext("failed to read %s: %s"), $file, $r) if $r;
-
+
+ if (! defined $im->Get("width") || ! defined $im->Get("height")) {
+ error sprintf(gettext("failed to get dimensions of %s"), $file);
+ }
+
my ($dwidth, $dheight);
if ($params{size} eq 'full') {