Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thumb properties stripped even without stripping enabled #417

Closed
chrysn opened this issue Aug 17, 2021 · 2 comments · Fixed by #505
Closed

Thumb properties stripped even without stripping enabled #417

chrysn opened this issue Aug 17, 2021 · 2 comments · Fixed by #505
Labels
I-Medium Issues that are breaking core functionality, but have a known workaround T-Bug Some piece of the software is not working as intended

Comments

@chrysn
Copy link

chrysn commented Aug 17, 2021

When oxipng is let lose on a file that contains Thumb::* metadata, things get lost (the example is utilizing that imagemagick's converter is producing Thumb::URI, Thumb::MTime and others automatically according to the thumbnail specification):

$ convert -thumbnail 128x128 rose: out.png
$ exiftool out.png |grep Thumb
Thumb Document Pages            : 1
Thumb Image Height              : 46
Thumb Image Width               : 70
Thumb Mimetype                  : image/pnm
Thumb Size                      : 9673BB
Thumb URI                       : file://rose:
$ oxipng out.png
Processing: out.png
    128x84 pixels, PNG format
    4x8 bits/pixel, RGBA
    IDAT size = 19588 bytes
    File size = 20091 bytes
Reducing image to 3x8 bits/pixel, RGB
Trying: 8 combinations
Found better combination:
    zc = 9  zs = 3  f = 5        16773 bytes
    IDAT size = 16773 bytes (2815 bytes decrease)
    file size = 16962 bytes (3129 bytes = 15.57% decrease)
Output: out.png
$ exiftool out.png |grep Thumb
Thumb URI                       : file://rose: 
$

Setting --strip=none or similar doesn't change anything here.

What's curious is that I find no mention of these particular names (or really anything "thumb" related) in oxipng, but still, that's what I get.

(Use case for reference: I've tried to use https://github.com/jesjimher/genthumbs/ with oxipng instead of optipng, and it took me quite some while to find why the newly generated thumbs weren't taken any more).

[edit: Note about file://rose: not being really correct removed, it just distracted from the difference]

@shssoichiro shssoichiro added I-Medium Issues that are breaking core functionality, but have a known workaround T-Bug Some piece of the software is not working as intended labels Sep 18, 2021
@andrews05
Copy link
Collaborator

The issue here is that the thumb properties are all stored in separate tEXt chunks but oxipng currently only supports one chunk of each type. Some refactoring will be required to resolve this...

@TPS
Copy link

TPS commented May 4, 2023

Some refactoring will be required to resolve this...

@andrews05 I think the same work would benefit #79?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-Medium Issues that are breaking core functionality, but have a known workaround T-Bug Some piece of the software is not working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants