Here's the brutal way I've detected interlaced PNGs among my expansions collection. Also found one with actual errors, probably benign.
Do not use this code if you don't know your bash from your csh.
I wrote these for inspection overview, not for automation.
For a directory containing OXP's as folders:
Code: Select all
# cd to a directory containing OXP's (e.g. $HOME/Oolite/GameData/AddOns, then
find . -type d -iname \*.oxp | while read d ; do
echo "$d" && cd "$d" && find -type f -iname \*.png -exec pngcheck "{}" \; | grep -v '^OK: .* non-interlaced' && cd - >/dev/null 2>&1
done
For a directory containing OXZ's as zip archives with oxz suffixes:
Code: Select all
# cd to a directory containing OXZ's (e.g. $HOME/Oolite/GameData/.ManagedAddOns, then
find -type f | grep '\.oxz$' | sed 's@^\./@@' | while read ; do
t=$(mktemp -d)
[ "x$t" = "x" ] && { echo "fail due to mktemp error" ; break ; }
echo $REPLY
unzip -qq "$REPLY" *.png -x *__MACOS* -d "$t/$REPLY"
find "$t" -type f -exec pngcheck "{}" \; | grep -v '^OK: .* non-interlaced' | sed "s@^OK: $t/$REPLY/@@"
rm -rf "$t"
done
The latter script will give output like:
Code: Select all
oolite.oxp.phkb.LinersMarkets.oxz
caution: filename not matched: *.png
caution: excluded filename not matched: *__MACOS*
oolite.oxp.Svengali.Library.oxz
Textures/lib_starmap_6.png (128x128, 32-bit RGB+alpha, interlaced, static, -0.7%).
The first of those indicates that the oxz contains no png files.
The second means the archive contained superflous apple cruft, where hidden files with png suffix that aren't actually png files will cause us headaches in these tests.
The third is a hit.
Obviously if you have a directory with both types, run both testers.
The output is messy, but fairlyeasily interpreted. Here are preened versions of the ones I found:
Anyone got an easy way to invoke these?
Code: Select all
oolite.oxp.EricWalch.DeepSpaceDredger.oxz/Textures/dredgerTraderEngines_emission.png (1024x1024, 8-bit grayscale, interlaced, static, 95.6%).
oolite.oxp.Svengali.Library.oxz/Textures/lib_starmap_6.png (128x128, 32-bit RGB+alpha, interlaced, static, -0.7%).
There's a ton of different png types in that last one!
Not sure if this one matters. The texture is so subtle, I'm not sure if it renders or not. I'll fire up and check if it spits errors into log presently.
Code: Select all
oolite.oxp.Norby.Towbar.oxz/Textures/towbar.png tEXt text contains NULL character(s)
ERROR: oolite.oxp.Norby.Towbar.oxz/Textures/towbar.png
Even though there are very few listed here, I don't have *all" the OX[PZ]s available, so IMHO, fixing Oolite to handle interlaced PNG files properly is the best way to go.
Edit: Addendum: Some of the build-in PNGs appear to have 'issues'. This is using the current 1.92.1 appimage.
Code: Select all
$ grep -i png Latest.log | grep -iE "warn|err" | sed 's/^.*\]: -----//' | sort | uniq
A PNG loading warning occurred for /tmp/.mount_ooliteknLhFe/usr/bin/Resources/Textures/oolite_buoy_diffuse.png: iCCP: cHRM chunk does not match sRGB.
A PNG loading warning occurred for /tmp/.mount_ooliteknLhFe/usr/bin/Resources/Textures/oolite_buoy_diffuse.png: iCCP: known incorrect sRGB profile.
A PNG loading warning occurred for /tmp/.mount_ooliteknLhFe/usr/bin/Resources/Textures/oolite_buoy_illumination.png: iCCP: cHRM chunk does not match sRGB.
A PNG loading warning occurred for /tmp/.mount_ooliteknLhFe/usr/bin/Resources/Textures/oolite_buoy_illumination.png: iCCP: known incorrect sRGB profile.