Feature #12625

Feature #5630: Reproducible builds

Make Ikiwiki resize images deterministically

Added by anonym about 2 months ago. Updated about 1 month ago.

Status:ConfirmedStart date:05/31/2017
Priority:NormalDue date:
Assignee:intrigeri% Done:

0%

Category:-
Target version:Tails_3.2
QA Check: Blueprint:
Feature Branch: Easy:
Type of work:Code Affected tool:

Description

As seen in #12566, 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.


Related issues

Related to Tails - Bug #12566: ikiwiki image size specification makes the ISO build unreproducible Resolved 05/19/2017

Associated revisions

Revision 14a77e5a
Added by anonym about 2 months ago

Don't resize image.

When Ikiwiki resizes it a timestamp is added which breaks
reproducibility.

Refs: #12625
Will-fix: #12566

History

#1 Updated by intrigeri about 2 months ago

  • Parent task set to #5630

#2 Updated by intrigeri about 2 months ago

  • Related to Bug #12566: ikiwiki image size specification makes the ISO build unreproducible added

#3 Updated by intrigeri about 2 months ago

  • Target version set to Tails_3.2

#4 Updated by anonym about 2 months ago

  • Status changed from Confirmed to In Progress

#5 Updated by intrigeri about 1 month ago

  • Status changed from In Progress to Confirmed

Also available in: Atom PDF