diff options
author | chrysn <chrysn@fsfe.org> | 2014-04-07 11:15:51 +0200 |
---|---|---|
committer | chrysn <chrysn@fsfe.org> | 2014-04-07 11:15:51 +0200 |
commit | 71b9ad33e04bd131e1d46cf0857ff83ed7407ba3 (patch) | |
tree | 5669e52fe8d783372958492006ec3a5ef9f7939f | |
parent | 292488818149958c9c9f2b8cf6575010dd84044b (diff) | |
download | ikiwiki-71b9ad33e04bd131e1d46cf0857ff83ed7407ba3.tar ikiwiki-71b9ad33e04bd131e1d46cf0857ff83ed7407ba3.tar.gz |
set the file type parameter after reading the image
imagemagick, when reading an image, sets its magick parameter to
indicate the file type, overriding the explicitly set file type for
output if it is set at creation.
as a result, previously (with graphicsmagick-libmagick-dev-compat
1.3.18-1 providing Image::Magick), svg output files were not png,
neither svg, but mvg (imagemagick vector graphics).
-rw-r--r-- | IkiWiki/Plugin/img.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index b92e24cc0..c861d7075 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -68,7 +68,7 @@ sub preprocess (@) { eval q{use Image::Magick}; error gettext("Image::Magick is not installed") if $@; - my $im = Image::Magick->new($issvg ? (magick => "png") : ()); + my $im = Image::Magick->new(); my $imglink; my $r = $im->Read($srcfile); error sprintf(gettext("failed to read %s: %s"), $file, $r) if $r; @@ -124,6 +124,7 @@ sub preprocess (@) { # don't actually write resized file in preview mode; # rely on width and height settings if (! $params{preview}) { + $im->set($issvg ? (magick => 'png') : ()); my @blob = $im->ImageToBlob(); writefile($imglink, $config{destdir}, $blob[0], 1); } |