Make Ikiwiki resize images deterministically
As seen in #12566 (closed), if we do something like:
[[!img introduction_to_gnome_and_the_tails_desktop/keyboard.png size="267x" link="no" alt="Menu in the top-right corner of the desktop to switch between different keyboard layouts"]]
the resulting resized image contains a timestamp => breaks reproducibility.
Ikiwiki does the resizing in IkiWiki/Plugin/img.pm
, using an interface
to ImageMagick. I think Ikiwiki just have to tell PerlMagick to do the
equivalent of convert +set date:create +set date:modify -define png:exclude-chunk=time
to fix this.
The two +set ...
things can be accomplished with:
--- a/IkiWiki/Plugin/img.pm
+++ b/IkiWiki/Plugin/img.pm
@@ -174,6 +174,9 @@ sub preprocess (@) {
my $r = $im->Read("$format:$srcfile\[$pagenumber]");
error sprintf(gettext("failed to read %s: %s"), $file, $r) if $r;
+ $im->Set('date:create' => NULL);
+ $im->Set('date:modify' => NULL);
+
if (! defined $im->Get("width") || ! defined $im->Get("height")) {
error sprintf(gettext("failed to get dimensions of %s"), $file);
}
but perhaps we only want to do this if SOURCE_DATE_EPOCH
is set, and
then set it to that value instead of NULL
?
Note that we still may need to find how to tell PerlMagick to do
-define png:exclude-chunk=time
.
Parent Task: #5630 (closed)
Related issues
- Related to #12566 (closed)
Original created by @anonym on 12625 (Redmine)