Quick batch png convertion (fix texture issues and warnings)
Posted: Sat Jun 22, 2013 9:44 am
This is for those who have libpng >= 1.6 (At the moment, ArchLinux users and maybe users of some other rolling-release distro. But it could appear in other distributions, as soon as libpng will be updated.)
In this version libpng is more strict about iccp. In Oolite, the result is a lot of warnings in the logfile about a "known incorrect sRGB profile" of many PNG textures.
Like this
This will also fix other kinds of problems with PNGs textures not loading.
Like this
Note: I discovered that, for some reason, the conversion breaks some of the replacement fonts. Backup your oolite-font.png or New-font.png before running the batch conversion command.
For this to work you need imagemagick.
First, do a backup of your AddOns directory
Then, in your AddOns directory, run this commad that will recursively find all your *.png and *.PNG files and reconvert them.
It could take some minutes and will print some warnings when it finds images with incorrect PNG profile.
Run Oolite and verify if all is working correctly. If not, you have the backup
In this version libpng is more strict about iccp. In Oolite, the result is a lot of warnings in the logfile about a "known incorrect sRGB profile" of many PNG textures.
Like this
Code: Select all
16:38:46.959 [texture.load.png.warning]: ----- A PNG loading warning occurred for /home/stefano/.Oolite/AddOns/ships.oxp/neolite.oxp/Textures/alien-coriolis.png: iCCP: known incorrect sRGB profile.
Like this
Code: Select all
16:38:46.960 [texture.load.png.error]: ***** A PNG loading error occurred for /home/stefano/.Oolite/AddOns/ships.oxp/neolite.oxp/Textures/alien-coriolis.png: bad adaptive filter value.
Note: I discovered that, for some reason, the conversion breaks some of the replacement fonts. Backup your oolite-font.png or New-font.png before running the batch conversion command.
For this to work you need imagemagick.
First, do a backup of your AddOns directory
Code: Select all
cd ~/.Oolite
cp -a AddOns AddOns-backup
Code: Select all
find -iname "*.png" -exec convert {} {} \;
Run Oolite and verify if all is working correctly. If not, you have the backup