#24544: core.files.images.get_image_dimensions broken on some valid PNG images
--------------------------------------+--------------------
     Reporter:  artscoop              |      Owner:  nobody
         Type:  Uncategorized         |     Status:  new
    Component:  File uploads/storage  |    Version:  1.7
     Severity:  Normal                |   Keywords:  PIL
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+--------------------
 Hi,
 second time I find a bug in the same function. Here, the function failed
 (exception raised and not caught) on a valid PNG file (this image:
 https://mega.co.nz/#!W0tXzBAK!iLprbqkVWFAzfcn2GUDRGHiH8Pxyi4DxCQi580shcec).
 The error raised by PIL is a `struct.error`, which should be expected but
 is not caught by the chunk feeder loop.

 The feeder knows this

 {{{
             except zlib.error as e:
                 # ignore zlib complaining on truncated stream, just feed
 more
                 # data to parser (ticket #19457).
                 if e.args[0].startswith("Error -5"):
                     pass
                 else:
                     raise
 }}}

 but does not know this

 {{{
 from struct import error
 ...

 except struct.error:
     pass
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24544>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.03052ba03116839a6f4e7c11d8fbb209%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to