Fix out-of-bounds image slices

This commit is contained in:
Rangi42
2025-07-01 18:06:03 -04:00
committed by Eldred Habert
parent 008920f533
commit 965288de38
12 changed files with 37 additions and 1 deletions

3
test/gfx/bad_slice.err Normal file
View File

@@ -0,0 +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!)
Conversion aborted after 1 error

1
test/gfx/bad_slice.flags Normal file
View File

@@ -0,0 +1 @@
-L 2,2:16,16

BIN
test/gfx/bad_slice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

View File

@@ -0,0 +1,2 @@
error: Image slice ((2, 2) to (34, 18)) is outside the image bounds (20x20)!
Conversion aborted after 1 error

View File

@@ -0,0 +1 @@
-L 2,2:4,2

BIN
test/gfx/oob_slice_wh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

View File

@@ -0,0 +1,2 @@
error: Image slice ((2, 99) to (10, 107)) is outside the image bounds (20x20)!
Conversion aborted after 1 error

View File

@@ -0,0 +1 @@
-L 2,99:1,1

BIN
test/gfx/oob_slice_xy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B