← Back to team overview

phatch-dev team mailing list archive

[Bug 529544] Re: Alpha channel of interlaced PNG's gets lost.

 

$ bzr diff
=== modified file 'phatch/lib/openImage.py'
--- phatch/lib/openImage.py	2010-02-26 07:33:56 +0000
+++ phatch/lib/openImage.py	2010-03-01 16:01:19 +0000
@@ -313,7 +313,7 @@
 
     def open_imagemagick(filename):
         """Open an image with Imagemagick."""
-        command = '%s "%s" -flatten -interlace none "%%s"'\
+        command = '%s "%s" -interlace none -background none -flatten "%%s"'\
             % (IMAGEMAGICK_CONVERT, filename)
         return open_image_with_command(filename, command, 'imagemagick')

$ bzr commit
Committing to: /home/stani/sync/python/phatch/repo/trunk/                      
modified phatch/lib/openImage.py
Committed revision 1654.                    

** Changed in: phatch
       Status: In Progress => Fix Committed

-- 
Alpha channel of interlaced PNG's gets lost.
https://bugs.launchpad.net/bugs/529544
You received this bug notification because you are a member of Phatch
Developers, which is subscribed to Phatch.

Status in Phatch = Photo & Batch!: Fix Committed

Bug description:
PIL 1.1.6 can't read interlaced PNGs:

In [1]: import Image

In [2]: apple = Image.open('ap
apple.png  apply      

In [2]: apple = Image.open('apple.png')

In [3]: apple.load()
---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)

/home/stani/Downloads/actionlist/<ipython console> in <module>()

/usr/lib/python2.6/dist-packages/PIL/ImageFile.pyc in load(self)
    153                     self.map = None
    154 
--> 155         self.load_prepare()
    156 
    157         # look for read/seek overrides


/usr/lib/python2.6/dist-packages/PIL/PngImagePlugin.pyc in load_prepare(self)
    335 
    336         if self.info.get("interlace"):
--> 337             raise IOError("cannot read interlaced PNG files")
    338 
    339         ImageFile.ImageFile.load_prepare(self)

IOError: cannot read interlaced PNG files

Therefore we use Imagemagick. Unfortunately the transparency or alpha channel gets lost. We should try to fix this.





References