Quick batch png convertion (fix texture issues and warnings)

For discussion of ports to POSIX based systems, especially using GNUStep.

Moderators: winston, another_commander, Getafix

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

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

Post 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.
User avatar
Tichy
---- E L I T E ----
---- E L I T E ----
Posts: 345
Joined: Wed Jul 11, 2012 5:48 pm

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

Post 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.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

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

Post 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
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

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

Post 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.
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

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

Post 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.
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

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

Post 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 !
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
Post Reply