Page 2 of 2

Re: Quick batch png convertion (fix texture issues and warni

Posted: Thu Aug 07, 2014 6:50 am
by cim
From the libpng docs - http://www.libpng.org/pub/png/libpng-manual.txt
Error detection in some chunks has improved; in particular the iCCP chunk reader now does pretty complete validation of the basic format. Some bad profiles that were previously accepted are now accepted with a warning or rejected, depending upon the png_set_benign_errors() setting, in particular the very old broken Microsoft/HP 3144-byte sRGB profile. Starting with libpng-1.6.11, recognizing and checking sRGB profiles can be avoided by means of

Code: Select all

    #ifdef PNG_SKIP_sRGB_CHECK_PROFILE
       png_set_option(png_ptr, PNG_SKIP_sRGB_CHECK_PROFILE,
           PNG_OPTION_ON);
    #endif
It's not a good idea to do this if you are using the "simplified API", which needs to be able to recognize an sRGB profile conveyed via the iCCP chunk.
Though, it's only a warning, not an error, so perhaps the answer is to do nothing and let OXP writers sort it out. If the log entries are getting in the way of other things, set texture.load.png.warning = no; in logcontrol.plist to suppress them.

Re: Quick batch png convertion (fix texture issues and warni

Posted: Thu Aug 07, 2014 8:38 am
by Tichy
cim wrote:
Though, it's only a warning, not an error, so perhaps the answer is to do nothing and let OXP writers sort it out. If the log entries are getting in the way of other things, set texture.load.png.warning = no; in logcontrol.plist to suppress them.
I agree. This is not an oolite, nor libpng problem. Libpng is only detecting a problem with the RGB profile of some images. Libpng is working correctly, and so does oolite. IMHO, the solution is to correct the PNGs profile.
I think that, as soon as libpng1.6 will be in all distros, every new and modified PNG will be corrected.

Re: Quick batch png convertion (fix texture issues and warni

Posted: Sat Aug 16, 2014 8:14 am
by Eric Walch
Getafix wrote:
The Oolite binaries downloaded from oolite.org, link to libpng1.4 distributed with the Oolite installer.
The mac build uses: libpng-1.5.13 That version has also issues with some files: PNG files saved in interlaced mode give errors. There are some oxp's around that use that format. There the effect is that the png is not loaded and the ship is 'black'.

One example with this problem is the original "Imperial Courier.oxp". (The current version on the Wiki has a modification date of 2007, so I assume Commander McLane has not changed the textures. The copy in Random Hits has fixed texture files)
It would be interesting to know if this problem with interlaced files is also present with libpng1.6

Re: Quick batch png convertion (fix texture issues and warni

Posted: Sat Aug 16, 2014 12:16 pm
by Lone_Wolf
Eric Walch wrote:
Getafix wrote:
The Oolite binaries downloaded from oolite.org, link to libpng1.4 distributed with the Oolite installer.
The mac build uses: libpng-1.5.13 That version has also issues with some files: PNG files saved in interlaced mode give errors. There are some oxp's around that use that format. There the effect is that the png is not loaded and the ship is 'black'.

One example with this problem is the original "Imperial Courier.oxp". (The current version on the Wiki has a modification date of 2007, so I assume Commander McLane has not changed the textures. The copy in Random Hits has fixed texture files)
It would be interesting to know if this problem with interlaced files is also present with libpng1.6

Looks like it is.


using libpng 1.6.12, running original imp courier oxp.

Code: Select all

14:08:50.182 [texture.load.png.error]: ***** A PNG loading error occurred for /home/panoramix/.Oolite/AddOns/impcourier2.oxp/Textures/imp_cour_tex.png: bad adaptive filter value.
after running the convert program, error is gone.

Re: Quick batch png convertion (fix texture issues and warni

Posted: Thu Aug 28, 2014 11:34 am
by Lone_Wolf
FYI :

I added a comment (see below) to Arch linux FS #41428 and as i kinda expected the arch bug report has now been closed .


------------------------------------
The consensus on Oolite BBS now appears to be that the best solution is to report the errors and have them fixed.

2 expansions have already been fixed.

Re: Quick batch png convertion (fix texture issues and warni

Posted: Fri Aug 29, 2014 11:26 pm
by Lone_Wolf
I found a few cases where running the find command from the first post gave errors.

To convert a problematic png , please run the convert command directly.

example :
Textures/foo.png gives the png error

Code: Select all

cd /path/to/oxz/folder/Textures
convert foo.png foo.png
This will overwrite foo.png with a corrected version.

NOTE : sometimes convert gives an error result, make sure you have a backup of the original foo.png !