scripts: Signed ints for grAb in fix-gfx-offsets

The fix-gfx-offsets script incorrectly used unsigned integers (I) when
interpreting grAb chunks, which resulted strange large values that are
close to 2^32 in buildcfg.txt. The fix is to use signed integers (i).
This commit is contained in:
Steven Elliott 2023-06-17 17:57:12 -04:00
parent e88e10208b
commit 98770096d3

View file

@ -20,7 +20,7 @@ class Graphic(object):
reader = png.Reader(file=open(self.filepath, "rb"))
for chunk in reader.chunks():
if chunk[0] == "grAb":
self.xoffset, self.yoffset = struct.unpack(">II", chunk[1])
self.xoffset, self.yoffset = struct.unpack(">ii", chunk[1])
self.has_offset = True