-
-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assertion fails in RGBGFX #1531
Comments
|
A smaller file that reproduces this error: $ ./rgbgfx -o foo.2bpp foo.png
FATAL: Tile at (8, 0) has 13 opaque colors, more than 4!
Conversion aborted after 1 error However, when the tile is fixed to be 4 colors, it does not fail the assertion, even with Same goes for this larger attempt: |
This 4-tile image fails the assertion: $ ./rgbgfx -n 64 -o foo.2bpp foo.png
rgbgfx: src/gfx/process.cpp:733: static uint16_t TileData::rowBitplanes(const Png::TilesVisitor::Tile&, const Palette&, uint32_t): Assertion `index < palette.size()' failed.
Aborted (core dumped) Note that it has a 5-color tile which is not caught! |
...oh. All it takes is this 3-tile image, not even with $ file foo.png
foo.png: PNG image data, 24 x 8, 8-bit/color RGBA, non-interlaced
$ ./rgbgfx -o foo.2bpp foo.png
rgbgfx: src/gfx/process.cpp:733: static uint16_t TileData::rowBitplanes(const Png::TilesVisitor::Tile&, const Palette&, uint32_t): Assertion `index < palette.size()' failed.
Aborted (core dumped) |
Edit: wait, I just retested and it does fail on the above three-tile foo.png with 0.8.0? Did I make a mistake here earlier? And 0.7.0, and 0.6.0! But 0.5.2 works ( |
Okay, |
So, #1546 may have "fixed" the issue after all. Not directly, but because palette assignment was broken to begin with (false negatives, i.e. allowing through 5-color tiles and somehow converting them anyway). We're not totally clear on why the logic was broken in the first place, but the assertion here has since been catching these cases, and the protopalette fix has also prevented false positives. The initial image in this issue no longer produces the bug. So we feel this can be closed. |
I'll add that some other reproducing images no longer cause the error, and they all had in common that they contain 5-colour tiles; so, since they no longer reproduce the assertion failure and the new colour-counting logic is straightforward and reasonably smoke-tested, I also gave my vote of confidence to closing this issue. |
RGBGFX somehow thinks a 5-color tile has 13 colors:
If the tile is edited to have 4 colors, an assertion is tripped:
Notes:
#00447e
and#00407d
to be the same color to avoid fusing has no effect on these issues.The text was updated successfully, but these errors were encountered: