]> git.saurik.com Git - wxWidgets.git/commitdiff
Correct decoding of 4-byte integers in png2c script.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 5 Feb 2011 20:24:52 +0000 (20:24 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 5 Feb 2011 20:24:52 +0000 (20:24 +0000)
Wrong multiplier was used for the most significant byte. Fix it even though it
doesn't risk to be a problem in practice as the images of such gigantic size
would surely break some limit anyhow.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

misc/scripts/png2c.py

index 5f451aa05d094e936e0bd6017b3b58f25c03028c..fe96def07920c648a5c6c24ad013482f85870090 100755 (executable)
@@ -56,8 +56,8 @@ for path in sys.argv[1:]:
 
         # Try to naively get its size if necessary
         if with_size:
-                width = bytes[19] + 16*bytes[18] + 256*bytes[17] + 4096*bytes[16]
-                height = bytes[23] + 16*bytes[22] + 256*bytes[21] + 4096*bytes[20]
+                width = bytes[19] + 16*bytes[18] + 256*bytes[17] + 65536*bytes[16]
+                height = bytes[23] + 16*bytes[22] + 256*bytes[21] + 65536*bytes[20]
                 size_suffix = "_%dx%d" % (width, height)
 
         # Create the C header