Re: PIL 1.1.6 ImageFile.Parser destroys data for PngImagePlugin

Alexey Borzenkov <[email protected]>
Newsgroups gmane.comp.python.image
Message-ID <[email protected]>
Hi Fredrik,

On Wed, Nov 4, 2009 at 6:43 PM, Fredrik Lundh <[email protected]> wrote:
> Thanks for the detailed analysis.  The fix in 1.1.7 is slightly
> different from the one you propose:
>
>    http://hg.effbot.org/pil-2009-raclette/changeset/fe4688f15fed/
>
> Not sure why the code considers it important to close the file at that
> point; I'll take another look at a look at the code and the history of
> that file when I find the time.

I looked at your changeset, and wonder why do you call image.load() in
finally? If Image.open fails, then self.image.load will also fail,
masking the original exception with attribute error. I don't remember
what I posted back then, but my patch was a little different:

http://git.kitsu.ru/patched/pil.git?a=commitdiff;h=943d371a903bf2af8ebc6b3be908bcdd6f8d0964
_______________________________________________
Image-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/image-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.