Page MenuHomePhabricator

Imagemagick should use "-strip"
Closed, DuplicatePublic

Description

Why does MW doesn't use "-strip" for Imagemagick? It removes meta data and comments.

Event Timeline

Subfader raised the priority of this task from to Needs Triage.
Subfader updated the task description. (Show Details)
Subfader subscribed.
Restricted Application added subscribers: Steinsplitter, Aklapper. · View Herald Transcript

Hi Subfader,
could you describe the problem which you see with the current behavior, if possible? Also see https://www.mediawiki.org/wiki/How_to_report_a_bug for more information. Thanks a lot for your help!

Hi Subfader,
could you describe the problem which you see with the current behavior, if possible? Also see https://www.mediawiki.org/wiki/How_to_report_a_bug for more information. Thanks a lot for your help!

Based on other bugs Subfader has filed, he wants image output of MW to be optimized aggressively for size, to reduce bandwidth needed to load sites. He's filed several bugs on this theme.


Reason why we don't currently

-strip can remove colour profiles which can cause rendering issues (Sometimes severe). OTOH colour profiles can also represent a significant percentage of the thumbnail size. There was some talk about using things like facebook's tinyrgb (T100976), or converting images directly to sRGB, but I think that stalled and I'm not sure its going anywhere right now

We also do want to keep one code comment, that links to the source of the image (in JPEG's, a COM segment), which we add. In the other direction from what you want, there's various people suggesting we should add additional metadata to help attribution and copyright concerns (T20871). My opinion is that that would be a good idea, provided we keep it very minimal and possibly configurable, but nobody is really working on that at the moment afaik

We do use -thumbnail, which to quote the docs:

This is similar to -resize, except it is optimized for speed and any image profile, other than a color profile, is removed to reduce the thumbnail size. To strip the color profiles as well, add -strip just before of after this option.

(Except on PNG its adds a whole slew of useless metadata.Which we definitely should fix at some point, but not exactly high priority. There was also some discussion about that on T108616 but that isn't public yet)


Conclusion: I think this bug should either be WONTFIXed (There's no way we're removing icc colour profiles outright with -strip. It would break a lot of images, and commons would have my head) alternatively, maybe it should be marked as a duplicate of T100546.

Thanks Bawolff, you got my intention right.

As mentioned in T111633, I used jpegoptim, but now I use -strip in Bitmap.php directly.

I'm pretty harsh on thumbs. They're just thumbs... I even compress PNGs with lossy pngquant.

Not every wiki is an encyclopedia so intentions of admins vary a lot. It surely wouldn't hurt if stripping metadata from thumbs was optional.

There is T100546 so I think this ticket can be closed.