]> granicus.if.org Git - python/commitdiff
struct.pack has become picky about h (short) and H (unsigned short).
authorJack Jansen <jack.jansen@cwi.nl>
Sun, 22 Oct 2000 21:59:23 +0000 (21:59 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Sun, 22 Oct 2000 21:59:23 +0000 (21:59 +0000)
Mac/Demo/imgbrowse/mac_image.py
Mac/Lib/PixMapWrapper.py

index c4b034ec29e9eabcbeef9f7e749f210d8cabbcae..4e3881f9f46716adc9b8046b6affb51b3ffa73ca 100644 (file)
@@ -13,7 +13,7 @@ def mkpixmap(w, h, fmt, data):
        """kludge a pixmap together"""
        fmtinfo = _fmt_to_mac[fmt]
        
-       rv = struct.pack("lhhhhhhhlllhhhhlll",
+       rv = struct.pack("lHhhhhhhlllhhhhlll",
                id(data)+MacOS.string_id_to_buffer, # HACK HACK!!
                w*2 + 0x8000,
                0, 0, h, w,
index 39e5f8eab038345aeaff810985737edcdf32c003..72a64ba0b9d722078d26479520b9a209940a2c59 100644 (file)
@@ -15,7 +15,7 @@ import imgformat
 # PixMap data structure element format (as used with struct)
 _pmElemFormat = {
        '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
                'top':'h',
                'left':'h',