Improve some RGBGFX error messages (#1876)

* Improve some RGBGFX error messages

* Fix assertion failure on ambiguous transparent/opaque pixels
This commit is contained in:
Rangi
2025-12-19 13:00:05 -05:00
committed by GitHub
parent 9b22ff3491
commit a9ab248fed
18 changed files with 56 additions and 24 deletions

2
test/gfx/ambiguous.err Normal file
View File

@@ -0,0 +1,2 @@
error: Color #ff800080 is neither transparent (alpha < 16) nor opaque (alpha >= 240) (first seen at (0, 8))
Conversion aborted after 1 error

BIN
test/gfx/ambiguous.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

View File

@@ -1,3 +1,3 @@
error: Image slice ((2, 2) to (130, 130)) is outside the image bounds (20x20)
note: Did you mean the slice "2,2:2,2"? (width and height are in tiles, not pixels!)
(Did you mean the slice "2,2:2,2"? The width and height are in tiles, not pixels!)
Conversion aborted after 1 error

View File

@@ -1,3 +1,3 @@
warning: Fusing colors #a9b9c9ff and #aabbccff into Game Boy color $66f5 [first seen at x: 1, y: 1]
warning: Colors #a9b9c9ff and #aabbccff both reduce to the same Game Boy color $66f5 (first seen at (1, 1))
FATAL: Tile (0, 0) contains the background color (#aabbccff)
Conversion aborted after 1 error

2
test/gfx/gray_alpha.err Normal file
View File

@@ -0,0 +1,2 @@
FATAL: Image is not compatible with a DMG palette specification: it contains transparent pixels
Conversion aborted after 1 error

View File

@@ -0,0 +1 @@
-c dmg

BIN
test/gfx/gray_alpha.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

View File

@@ -0,0 +1,2 @@
FATAL: Image is not compatible with a DMG palette specification: it contains a color #111111ff that reduces to the same gray shade as another one
Conversion aborted after 1 error

View File

@@ -0,0 +1 @@
-c dmg

BIN
test/gfx/gray_conflict.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

View File

@@ -0,0 +1,2 @@
FATAL: Image is not compatible with a DMG palette specification: it contains a non-gray color #50555fff
Conversion aborted after 1 error

View File

@@ -0,0 +1 @@
-c dmg

BIN
test/gfx/gray_nongray.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

View File

@@ -0,0 +1,2 @@
FATAL: Image is not compatible with a DMG palette specification: it contains too many colors (5)
Conversion aborted after 1 error

View File

@@ -0,0 +1 @@
-c dmg

BIN
test/gfx/gray_too_many.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B