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

Bug #1195724 reported by excruciated
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Widelands media development
Fix Released
Undecided
kaputtnik
widelands
Fix Released
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

Revision history for this message
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
Revision history for this message
Nasenbaer (nasenbaer) wrote :

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

Revision history for this message
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)
Revision history for this message
SirVer (sirver) wrote :

Setting to incomplete for bug sweeping.

Revision history for this message
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)
Revision history for this message
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.

Revision history for this message
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
Revision history for this message
kaputtnik (franku) wrote :
Revision history for this message
kaputtnik (franku) wrote :
Revision history for this message
SirVer (sirver) wrote :

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

Changed in widelands:
status: Fix Committed → Confirmed
Revision history for this message
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).

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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

Revision history for this message
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

Revision history for this message
kaputtnik (franku) wrote :
Revision history for this message
kaputtnik (franku) wrote :

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

Revision history for this message
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 ...

Revision history for this message
SirVer (sirver) wrote :
Revision history for this message
SirVer (sirver) wrote :

arlg, sorry, wrong window :/

kaputtnik (franku)
Changed in widelands:
status: Confirmed → Fix Committed
Changed in widelands-media:
assignee: nobody → kaputtnik (franku)
status: New → Confirmed
kaputtnik (franku)
Changed in widelands-media:
status: Confirmed → Fix Committed
GunChleoc (gunchleoc)
tags: added: cleanups
removed: libpng
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Changed in widelands-media:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.