alpine-alpaca / asefile

Library for loading Aseprite files. Directly reads binary Aseprite files and does not require you to export files to JSON.
MIT License
43 stars 15 forks source link

"Indexed colors without a palette" for indexed image that has a palette #12

Closed KeyboardDanni closed 2 years ago

KeyboardDanni commented 2 years ago

Asefile does not seem to think that this indexed color image has a palette, even though it has a full 256-color palette stored in it. Here's what it looks like in Aseprite:

2022-01-15 13_26_21-animation_tracks ase - Aseprite v1 2 28-x64

For some reason this gives Invalid Aseprite input: Indexed colors without a palette

The source .ase file (had to zip this or Github wouldn't let me attach it): animation_tracks.ase.zip

KeyboardDanni commented 2 years ago

It appears that Aseprite is saving only the old style palette chunk (0x0004) and not the new one if there are exactly 256 colors in the palette. According to the documentation on the file format:

"Ignore this chunk if you find the new palette chunk (0x2019)"

We aren't finding the new palette chunk in this file, so we should be using the old palette chunk to populate the palette data.

KeyboardDanni commented 2 years ago

Wrote a fix for this in #13

alpine-alpaca commented 2 years ago

I merged Pr #13 and released it with v0.3.4.