From: intrigeri Date: Fri, 1 Sep 2017 19:26:26 +0000 (+0000) Subject: img: resize images in a deterministic manner. X-Git-Tag: 3.20171001~9^2 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/146f1d9ab546ffc4aebef79340c6691720513f46 img: resize images in a deterministic manner. --- diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index 740c44f96..79cfba20f 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -174,6 +174,12 @@ sub preprocess (@) { my $r = $im->Read("$format:$srcfile\[$pagenumber]"); error sprintf(gettext("failed to read %s: %s"), $file, $r) if $r; + if ($config{deterministic}) { + $im->Set('date:create' => 0); + $im->Set('date:modify' => 0); + $im->Set('option' => 'png:exclude-chunk=time'); + } + if (! defined $im->Get("width") || ! defined $im->Get("height")) { error sprintf(gettext("failed to get dimensions of %s"), $file); }