img: resize images in a deterministic manner.

master
intrigeri 2017-09-01 19:26:26 +00:00
parent 948bc22ae4
commit 146f1d9ab5
1 changed files with 6 additions and 0 deletions

View 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);
}