Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 475764 - games-strategy/boswars-2.7 crashes at start with "...Error reading the PNG file."
Summary: games-strategy/boswars-2.7 crashes at start with "...Error reading the PNG fi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Games
URL: https://savannah.nongnu.org/bugs/inde...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-04 19:18 UTC by Florian Manschwetus
Modified: 2013-07-29 21:29 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
boswars-2.7-r1.ebuild.diff (boswars-2.7-r1.ebuild.diff,1.57 KB, patch)
2013-07-29 17:06 UTC, Julian Ospald
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Manschwetus 2013-07-04 19:18:39 UTC
Can't open file 'preferences.lua': No such file or directory
Bos Wars V2.7.0, (c) 1998-2013 by the Bos Wars and Stratagus Project.
  written by Lutz Sammer, Fabrice Rossi, Vladi Shabanski, Patrice Fortier,
Jon Gabrielson, Andreas Arens, Nehal Mistry, Jimmy Salmon, Francois Beerten and others.
        (http://www.boswars.org)
Compile options VORBIS THEORA 

Bos Wars may be copied only under the terms of the GNU General Public License
which must be distributed with this program.

DISCLAIMER:
This software is provided as-is.  The author(s) can not be held liable for any
damage that might arise from the use of this software.
Use it at your own risk.

libpng warning: iCCP: known incorrect sRGB profile
libpng error: IDAT: invalid distance too far back
Error reading the PNG file.
Can't load the graphic `graphics/ui/ui_minimap.png'

The file is there and could be opened with gwenview, beside it looks a bit strange but no idea how it should look. Moving away the file changes the error.
Comment 1 Tupone Alfredo gentoo-dev 2013-07-14 19:39:11 UTC
I think we should wait for a fix on libpng


However it could be fixed by running
optipng -fix ui_minimap.png
optipng -fix ui_bpanel_200x264.png
optipng -fix ui_info.png

You can get optipng by running 
emerge optipng
Comment 2 Florian Manschwetus 2013-07-29 14:57:22 UTC
fixing dosn't seem to work here
Comment 3 Florian Manschwetus 2013-07-29 16:09:44 UTC
would be interesting if this due to illformed pngs by boswars or due a bug in libpng? As in eigther case it comes down to something that can't be solved in distribution scope alone.
A quick look didn't show me up an matching bug against libpng 1.6.3 on libpngs bugtracker.
Comment 4 Julian Ospald 2013-07-29 16:23:03 UTC
that is a known issue, libpng-1.6 is just stricter
Comment 5 Florian Manschwetus 2013-07-29 16:29:37 UTC
so it is an corrupted png by boswars, is there a way to correct a png, maybe they are faster in fixing this when there is some suggestion, btw the original files seem to be unchanged since 5 years in their svn
e.g. svn export svn://bos.seul.org/svn/bos/bos/trunk/graphics/ui/ui_minimap.png gives the file, this could indeed be fixed by optipng, but result is a close to complete black image.
Comment 6 Julian Ospald 2013-07-29 17:06:04 UTC
Created attachment 354534 [details, diff]
boswars-2.7-r1.ebuild.diff
Comment 7 Florian Manschwetus 2013-07-29 17:18:39 UTC
there is a tool shipped with libpng-1.6.3 that helps out I made a small bashscipt to fix boswars files (executed as root in /usr/share/boswars)
for i in $(find . -iname '*.png'); do pngfix -q ${i}; if [[ $? -eq 1 ]]; then echo ${i} broken ; pngfix -q --out=${i/.png/_fixed.png} ${i} ; pngfix -q ${i/.png/_fixed.png} ; if [[ $? -eq 0 ]]; then echo "${i} fixed successfully" ;mv ${i/.png/_fixed.png} ${i};fi; fi ; done
Comment 8 Julian Ospald 2013-07-29 18:05:12 UTC
(In reply to Florian Manschwetus from comment #7)
> there is a tool shipped with libpng-1.6.3 that helps out I made a small
> bashscipt to fix boswars files (executed as root in /usr/share/boswars)
> for i in $(find . -iname '*.png'); do pngfix -q ${i}; if [[ $? -eq 1 ]];
> then echo ${i} broken ; pngfix -q --out=${i/.png/_fixed.png} ${i} ; pngfix
> -q ${i/.png/_fixed.png} ; if [[ $? -eq 0 ]]; then echo "${i} fixed
> successfully" ;mv ${i/.png/_fixed.png} ${i};fi; fi ; done

There are already numerous tools to do that (e.g. https://bugs.gentoo.org/show_bug.cgi?id=466190#c11 ) and I fixed it, see the attached ebuild diff.
Comment 9 Julian Ospald 2013-07-29 21:29:03 UTC
+*boswars-2.7-r1 (29 Jul 2013)
+
+  29 Jul 2013; Julian Ospald <hasufell@gentoo.org> +boswars-2.7-r1.ebuild:
+  fix broken png images wrt #475764