[Tilecache] How to contribute to TileCache?

SQ9MEV groups at sq9mev.info
Mon Mar 12 13:22:38 EDT 2012


Hi everybody!

How to contribute to TileCache?

I've got a little patch which enables TileCache to work with paletted 
transparency pngs with PIL development version 
(http://hg.effbot.org/pil-2009-raclette). Works well for me with 
MapServer and AGG Driver with PALETTE option.

Patch is in attachment.

-- 
Bartek
-------------- next part --------------
Index: Layer.py
===================================================================
--- Layer.py	(wersja 459)
+++ Layer.py	(kopia robocza)
@@ -431,7 +431,7 @@
                 miny = maxy - self.size[1]
                 subimage = image.crop((minx, miny, maxx, maxy))
                 buffer = StringIO.StringIO()
-                if image.info.has_key('transparency'): 
+                if image.info.has_key('transparency') and isinstance(image.info['transparency'], int):
                     subimage.save(buffer, self.extension, transparency=image.info['transparency'])
                 else:
                     subimage.save(buffer, self.extension)
@@ -485,7 +485,7 @@
         watermarkedImage.paste(wmark, (0,0))
         watermarkedImage = Image.composite(watermarkedImage, tileImage, watermarkedImage)
         buffer = StringIO.StringIO()
-        if watermarkedImage.info.has_key('transparency'):
+        if watermarkedImage.info.has_key('transparency') and isinstance(watermarkedImage.info['transparency'], int):
             watermarkedImage.save(buffer, self.extension, transparency=compositeImage.info['transparency'])
         else:
             watermarkedImage.save(buffer, self.extension)


More information about the Tilecache mailing list