struct.pack has become picky about h (short) and H (unsigned short).
This commit is contained in:
parent
339ecc61f8
commit
185f42d917
|
@ -13,7 +13,7 @@ def mkpixmap(w, h, fmt, data):
|
||||||
"""kludge a pixmap together"""
|
"""kludge a pixmap together"""
|
||||||
fmtinfo = _fmt_to_mac[fmt]
|
fmtinfo = _fmt_to_mac[fmt]
|
||||||
|
|
||||||
rv = struct.pack("lhhhhhhhlllhhhhlll",
|
rv = struct.pack("lHhhhhhhlllhhhhlll",
|
||||||
id(data)+MacOS.string_id_to_buffer, # HACK HACK!!
|
id(data)+MacOS.string_id_to_buffer, # HACK HACK!!
|
||||||
w*2 + 0x8000,
|
w*2 + 0x8000,
|
||||||
0, 0, h, w,
|
0, 0, h, w,
|
||||||
|
|
|
@ -15,7 +15,7 @@ import imgformat
|
||||||
# PixMap data structure element format (as used with struct)
|
# PixMap data structure element format (as used with struct)
|
||||||
_pmElemFormat = {
|
_pmElemFormat = {
|
||||||
'baseAddr':'l', # address of pixel data
|
'baseAddr':'l', # address of pixel data
|
||||||
'rowBytes':'h', # bytes per row, plus 0x8000
|
'rowBytes':'H', # bytes per row, plus 0x8000
|
||||||
'bounds':'hhhh', # coordinates imposed over pixel data
|
'bounds':'hhhh', # coordinates imposed over pixel data
|
||||||
'top':'h',
|
'top':'h',
|
||||||
'left':'h',
|
'left':'h',
|
||||||
|
|
Loading…
Reference in New Issue