dressupgeekout / lunapurpura

Reimplementation of Purple Moon's games from the 1990s (WIP) - NOTE: ScummVM port in progress
https://dressupgeekout.github.io/lunapurpura/
BSD 2-Clause "Simplified" License
8 stars 1 forks source link

Some XPK entries have zero width and zero height #54

Closed dressupgeekout closed 4 years ago

dressupgeekout commented 4 years ago

Some XPK files -- exclusively those which represent journal entry fonts, apparently -- claim to have sub-images which are of dimensions 0x0.

charlotte@dawnchorus:~/devel/lunapurpura/TRICKY/j/IDGlobal ../../../build/src/xpk/xpk  -c 44000-IDPalette.CLU -p -o 52000-Rockett18.XPK.png 52000-Rockett18.XPK 
96 entry(ies):
    XPKEntry offset=1936 dimensions=0x0 pos=0x0
    XPKEntry offset=1936 dimensions=2x15 pos=8x1
    XPKEntry offset=1951 dimensions=4x6 pos=6x0
    XPKEntry offset=1974 dimensions=13x11 pos=6x1
    XPKEntry offset=2034 dimensions=10x19 pos=6x0
    XPKEntry offset=2111 dimensions=10x17 pos=6x1
    XPKEntry offset=2198 dimensions=8x19 pos=6x0
    XPKEntry offset=2245 dimensions=2x4 pos=6x0
    XPKEntry offset=2253 dimensions=5x18 pos=6x0
    XPKEntry offset=2285 dimensions=8x20 pos=4x0
    XPKEntry offset=2323 dimensions=7x7 pos=7x2

Of course, this screws things up when you're trying to actually decode the images:

libpng warning: Image width is zero in IHDR
libpng warning: Image height is zero in IHDR
libpng error: Invalid IHDR data
xpk: couldn't write PNG!: Error

So, what to do?

dressupgeekout commented 4 years ago

178953b5b9d626aa41e9e639de9f2d82727cbb07 addresses this issue, essentially.