Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • T tails
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 920
    • Issues 920
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 18
    • Merge requests 18
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • tails
  • tails
  • Issues
  • #12625
Closed
Open
Created May 31, 2017 by anonym@anonymMaintainer

Make Ikiwiki resize images deterministically

Originally created by @anonym on #12625 (Redmine)

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)
Edited May 15, 2020 by anonym
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking