Commits

Fredrik Lundh  committed 04b67bc

Set loop property to number of iterations, instead of just setting it
to 1/true (from Valentino Volonghi).

  • Participants
  • Parent commits 9246ae1

Comments (0)

Files changed (2)

 
   http://bitbucket.org/effbot/pil-2009-raclette/changesets/
 
++ Set GIF loop info property to the number of iterations if a NETSCAPE
+  loop extension is present, instead of always setting it to 1 (from
+  Valentino Volonghi).
+
 + Improved PNG compression (from Alexey Borzenkov).
 
 + Read interlaced PNG files (from Conrado Porto Lopes Gouvêa)

File PIL/GifImagePlugin.py

                     #
                     self.info["extension"] = block, self.fp.tell()
                     if block[:11] == "NETSCAPE2.0":
-                        self.info["loop"] = 1 # FIXME
+                        block = self.data()
+                        if len(block) >= 3 and ord(block[0]) == 1:
+                            self.info["loop"] = i16(block[1:3])
                 while self.data():
                     pass