Serious bug in PIL's handling of PNG images

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Serious bug in PIL's handling of PNG images

Ivan Tkatchev

Please see the relevant discussion and patch here:


This is a very serious bug that affects many upstream packages. 

It would be nice if a fix made its way into the official PIL release so that users would not have to suffer.

Thank you.


_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig
Reply | Threaded
Open this post in threaded view
|

Re: Serious bug in PIL's handling of PNG images

Oliver Tonnhofer-4
Hi,

On 14.02.2011, at 12:50, Ivan Tkatchev wrote:
> Please see the relevant discussion and patch here:
>
> http://stackoverflow.com/questions/4217869/python-pil-all-areas-of-png-with-opacity-0-have-their-opacity-set-to-1
>
> This is a very serious bug that affects many upstream packages.

It's questionable if this is a serious bug. It's more a missing feature (read alpha from paletted images).

> It would be nice if a fix made its way into the official PIL release so that users would not have to suffer.

I did some contributions to improve the PNG handling and there are already in the development trunk for 1.2. You can get a source package here: https://bitbucket.org/olt/pil-2009-raclette/get/tip.tar.bz2

Regards,
Oliver
_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig
Reply | Threaded
Open this post in threaded view
|

Re: Serious bug in PIL's handling of PNG images

Joao S. O. Bueno Calligaris
On Thu, Feb 17, 2011 at 4:56 AM, Oliver Tonnhofer <[hidden email]> wrote:

> Hi,
>
> On 14.02.2011, at 12:50, Ivan Tkatchev wrote:
>> Please see the relevant discussion and patch here:
>>
>> http://stackoverflow.com/questions/4217869/python-pil-all-areas-of-png-with-opacity-0-have-their-opacity-set-to-1
>>
>> This is a very serious bug that affects many upstream packages.
>
> It's questionable if this is a serious bug. It's more a missing feature (read alpha from paletted images).


Since the alpha in paletted PNG images is in the PNG specification,
and PIL does support alpha I am quite certain this can be named a
bug. And a severe misfeature.


>> It would be nice if a fix made its way into the official PIL release so that users would not have to suffer.
>
> I did some contributions to improve the PNG handling and there are already in the development trunk for 1.2. You can get a source package here: https://bitbucket.org/olt/pil-2009-raclette/get/tip.tar.bz2

I appreciate your work -- congratulations for the effort. Have you
addressesd this particular issue of palleted alpha support?

  js
 -><-


> Regards,
> Oliver
> _______________________________________________
> Image-SIG maillist  -  [hidden email]
> http://mail.python.org/mailman/listinfo/image-sig
>
_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig
Reply | Threaded
Open this post in threaded view
|

Re: Serious bug in PIL's handling of PNG images

Oliver Tonnhofer-4

On 17.02.2011, at 13:39, Joao S. O. Bueno wrote:
>> It's questionable if this is a serious bug. It's more a missing feature (read alpha from paletted images).
>
> Since the alpha in paletted PNG images is in the PNG specification,
> and PIL does support alpha I am quite certain this can be named a
> bug. And a severe misfeature.

But by far not a serious one. Or how do you call bugs that crash your system then?

>> I did some contributions to improve the PNG handling and there are already in the development trunk for 1.2. You can get a source package here: https://bitbucket.org/olt/pil-2009-raclette/get/tip.tar.bz2
>
> I appreciate your work -- congratulations for the effort. Have you
> addressesd this particular issue of palleted alpha support?


Yes, it should load the alpha information for paletted images. Let me know if you have any issues with it, I would count that as a bug of my patch :)


Regards,
Oliver

_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig
Reply | Threaded
Open this post in threaded view
|

Re: Serious bug in PIL's handling of PNG images

Joao S. O. Bueno Calligaris
On Thu, Feb 17, 2011 at 10:53 AM, Oliver Tonnhofer <[hidden email]> wrote:
>
> On 17.02.2011, at 13:39, Joao S. O. Bueno wrote:
>>> It's questionable if this is a serious bug. It's more a missing feature (read alpha from paletted images).
>>
>> Since the alpha in paletted PNG images is in the PNG specification,
>> and PIL does support alpha I am quite certain this can be named a
>> bug. And a severe misfeature.
>
> But by far not a serious one. Or how do you call bugs that crash your system then?

Indeed, when reading teh subject here, I  could not help thinking of a
crafted PNG to run arbitrary Python code.  :-)

  js
 -><-
_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig