Warnings with newer libpng versions (iCCP: known incorrect sRGB profile)

Bug #1195724 reported by excruciated on 2013-06-28
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Widelands media development
Undecided
kaputtnik
widelands
Undecided
Unassigned

Bug Description

When running Wl (recently built from source on Arch) I have lately been getting long lists of warnings saying the following:

libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
...

Per, for example, http://www.playonlinux.com/en/topic-10442.html , this is due to a recent update to libpng where it now prints these warnings even though the incorrect color profiles will not really hurt anything and are safe to ignore (they are just annoying). As most (linux) systems are still using previous libpng versions, most are probably not seeing this. I am using Arch's libpng 1.6.2-3.

I wouldn't have reported this except for the fact that the fix is very simple with imagemagick. A large number of .png images in the Wl source have these incorrect profiles, but I got imagemagick to convert them en masse:

cd /usr/share/widelands
for i in `find . | grep .png`; do convert "$i" -strip "$i"; done

As it goes through, imagemagick will print:

...
convert: iCCP: known incorrect sRGB profile `./tribes/atlanteans/advanced_shield/menu.png' @ warning/png.c/MagickPNGWarningHandler/1830.
convert: iCCP: known incorrect sRGB profile `./tribes/atlanteans/baker/menu.png' @ warning/png.c/MagickPNGWarningHandler/1830.
convert: iCCP: known incorrect sRGB profile `./tribes/atlanteans/bakingtray/menu.png' @ warning/png.c/MagickPNGWarningHandler/1830.
...

But it will fix these problems, and the warnings from libpng when running Wl will be no more. If a similar process were done on the main Wl trunk, this would save users from having to do it themselves as the less-bleeding-edge distros begin to update to the new libpng.

Related branches

lp:~widelands-dev/widelands/png_alternative_method
Rejected for merging into lp:widelands
SirVer: Disapprove on 2016-01-18
Tino: Approve on 2016-01-17
kaputtnik: Approve on 2016-01-17
lp:~widelands-dev/widelands/png_fix_only_relevant
Tino: Approve on 2016-01-18
SirVer: Approve on 2016-01-18
SirVer (sirver) wrote :

Thanks for the report and the fix. This is very useful.

I think we must do this, the question is just when: when we do this, all .png files in the repo will change which will blow up the repo and be a huge commit. I suggest waiting till shortly before the next release (when we will also en masse pngoptimize the .pngs again I guess) to do this. What do others think?

Changed in widelands:
status: New → Incomplete
milestone: none → build18-rc1
Nasenbaer (nasenbaer) wrote :

I agree with SirVer.
Maybe this would be good to apply once the spritmap branch is merged?

SirVer (sirver) wrote :

Yes, this should be done with the spritemap. That means we will not do it for b18.

Changed in widelands:
milestone: build18-rc1 → build19-rc1
assignee: nobody → SirVer (sirver)
SirVer (sirver) wrote :

Setting to incomplete for bug sweeping.

Hans Joachim Desserud (hjd) wrote :

I can verify the warnings still appear with libpng 1.6.13-1. SirVer: What's the current status of the spritemap, has anyone looked at that lately? :)

Changed in widelands:
status: Incomplete → Confirmed
summary: - Warnings with newer libpng versions
+ Warnings with newer libpng versions (iCCP: known incorrect sRGB profile)
SirVer (sirver) wrote :

This can be addressed now again with the refactorings in place it should be easier to write a c++ tool that can compress and decompress the images.

SirVer (sirver) wrote :

Fixed in r7709.

In hindsight we should just have ran the command when this bug was opened... oh well.

Changed in widelands:
assignee: SirVer (sirver) → nobody
status: Confirmed → Fix Committed
kaputtnik (franku) wrote :
kaputtnik (franku) wrote :
SirVer (sirver) wrote :

I rolled this fix back in trunk by force removing this commit.

Changed in widelands:
status: Fix Committed → Confirmed
kaputtnik (franku) wrote :

Thanks. The problem with "convert --strip" is that it removes each color profile from the png files. So the graphics engine has to to guess, which colors are used. That may lead into a "fail guess" and some images lost quality (coloring may get shifted).

kaputtnik (franku) wrote :

The wrong transparent shown in "matchbox_ruins.png" ( #9 ) is not caused by removing the color profile. This is caused by a former commit.

SirVer (sirver) wrote :

I also stumbled over http://trac.wildfiregames.com/changeset/16350 - which I like a lot. The 'wrong' profile does not seem to hurt us in any ways, so why not suppress the warning?

of course, we are using SDL_Image which will make that a little harder.

SirVer (sirver) wrote :

I wrote a small program that just loads a PNG using our graphics code and terminates. This is an indicator that then prints if libpng is unhappy with a PNG. With that I could figure out which PNGs are troublesome and in current trunk (r7709), these are the problematic PNGs:

pics/genstats_points.png
pics/genstats_trees.png
pics/prefer_heroes.png
pics/prefer_rookies.png
pics/ware_list_bg.png
src/graphic/text/test/pics/red_box.png
tribes/wares/blackroot_flour/menu.png
tribes/wares/bread_atlanteans/menu.png
tribes/wares/bread_paddle/menu.png
tribes/wares/corn/menu.png
tribes/wares/cornmeal/menu.png
tribes/wares/diamond/menu.png
tribes/wares/fire_tongs/menu.png
tribes/wares/fishing_net/menu.png
tribes/wares/flour/menu.png
tribes/wares/hammer/menu.png
tribes/wares/hunting_bow/menu.png
tribes/wares/log/menu.png
tribes/wares/marble_column/menu.png
tribes/wares/meat/menu.png
tribes/wares/milking_tongs/menu.png
tribes/wares/pick/menu.png
tribes/wares/planks/menu.png
tribes/wares/quartz/menu.png
tribes/wares/saw/menu.png
tribes/wares/scythe/menu.png
tribes/wares/shield_advanced/menu.png
tribes/wares/shield_steel/menu.png
tribes/wares/shovel/menu.png
tribes/wares/smoked_fish/menu.png
tribes/wares/smoked_meat/menu.png
tribes/wares/spear/menu.png
tribes/wares/spear_advanced/menu.png
tribes/wares/trident_double/menu.png
tribes/wares/trident_heavy_double/menu.png
tribes/wares/trident_light/menu.png
tribes/wares/trident_long/menu.png
tribes/wares/trident_steel/menu.png

Tino (tino79) wrote :

And these are the files in lp:~widelands-dev/widelands/png_alternative_method with a incorrect profile:

Known incorrect sRGB profile found in c:\data\bzr\widelands\working\pics\genstats_trees.png
Known incorrect sRGB profile found in c:\data\bzr\widelands\working\tribes\wares\blackroot_flour\menu.png
Known incorrect sRGB profile found in c:\data\bzr\widelands\working\tribes\wares\bread_atlanteans\menu.png
Known incorrect sRGB profile found in c:\data\bzr\widelands\working\tribes\wares\cornmeal\menu.png
Known incorrect sRGB profile found in c:\data\bzr\widelands\working\tribes\wares\flour\menu.png
Known incorrect sRGB profile found in c:\data\bzr\widelands\working\tribes\wares\log\menu.png
Known incorrect sRGB profile found in c:\data\bzr\widelands\working\tribes\wares\meat\menu.png
Known incorrect sRGB profile found in c:\data\bzr\widelands\working\tribes\wares\pick\menu.png
Known incorrect sRGB profile found in c:\data\bzr\widelands\working\tribes\wares\planks\menu.png
Known incorrect sRGB profile found in c:\data\bzr\widelands\working\tribes\wares\shield_advanced\menu.png
Known incorrect sRGB profile found in c:\data\bzr\widelands\working\tribes\wares\shield_steel\menu.png
Known incorrect sRGB profile found in c:\data\bzr\widelands\working\tribes\wares\smoked_fish\menu.png
Known incorrect sRGB profile found in c:\data\bzr\widelands\working\tribes\wares\smoked_meat\menu.png
Known incorrect sRGB profile found in c:\data\bzr\widelands\working\tribes\wares\trident_double\menu.png
Known incorrect sRGB profile found in c:\data\bzr\widelands\working\tribes\wares\trident_heavy_double\menu.png

kaputtnik (franku) wrote :

Oh, didn't get informed of your last posts.

kaputtnik (franku) wrote :

For the additional branch i used just imagmagick's

convert inputfile.png outputfile.png

to the files which are causing this issue.

That solves the problem... imho ...

SirVer (sirver) wrote :

arlg, sorry, wrong window :/

kaputtnik (franku) on 2016-01-18
Changed in widelands:
status: Confirmed → Fix Committed
Changed in widelands-media:
assignee: nobody → kaputtnik (franku)
status: New → Confirmed
kaputtnik (franku) on 2016-01-18
Changed in widelands-media:
status: Confirmed → Fix Committed
GunChleoc (gunchleoc) on 2016-10-10
tags: added: cleanups
removed: libpng
GunChleoc (gunchleoc) on 2016-10-25
Changed in widelands:
status: Fix Committed → Fix Released
Changed in widelands-media:
status: Fix Committed → Fix Released
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers