]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
img: resize images in a deterministic manner.
authorintrigeri <intrigeri@boum.org>
Fri, 1 Sep 2017 19:26:26 +0000 (19:26 +0000)
committerintrigeri <intrigeri@boum.org>
Fri, 1 Sep 2017 19:26:26 +0000 (19:26 +0000)
IkiWiki/Plugin/img.pm

index 740c44f96045e19e5ed4f79dcca8db4369feeae6..79cfba20fb48564849b41717907c7f860904fe02 100644 (file)
@@ -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);
                }