gnome-games r7989 - trunk/glchess/src/lib/scene/opengl



Author: rancell
Date: Thu Oct  9 04:17:53 2008
New Revision: 7989
URL: http://svn.gnome.org/viewvc/gnome-games?rev=7989&view=rev

Log:
Merge changes from upstream pypng

Modified:
   trunk/glchess/src/lib/scene/opengl/png.py

Modified: trunk/glchess/src/lib/scene/opengl/png.py
==============================================================================
--- trunk/glchess/src/lib/scene/opengl/png.py	(original)
+++ trunk/glchess/src/lib/scene/opengl/png.py	Thu Oct  9 04:17:53 2008
@@ -209,7 +209,7 @@
         outfile.write(data)
         checksum = zlib.crc32(tag)
         checksum = zlib.crc32(data, checksum)
-        outfile.write(struct.pack("!I", checksum))
+        outfile.write(struct.pack("!i", checksum))
 
     def write(self, outfile, scanlines):
         """
@@ -403,10 +403,10 @@
         self.offset = 0
 
     def read(self, n):
-        r = buf[offset:offset+n]
+        r = self.buf[self.offset:self.offset+n]
         if isinstance(r, array):
             r = r.tostring()
-        offset += n
+        self.offset += n
         return r
 
 class Reader:
@@ -468,8 +468,8 @@
         verify = struct.pack('!i', verify)
         if checksum != verify:
             # print repr(checksum)
-            (a,) = struct.unpack('!I', checksum)
-            (b,) = struct.unpack('!I', verify)
+            (a, ) = struct.unpack('!I', checksum)
+            (b, ) = struct.unpack('!I', verify)
             raise ValueError("Checksum error in %s chunk: 0x%X != 0x%X"
                              % (tag, a, b))
         return tag, data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]