#24948: BMP Image File treated as invalid
----------------------------+------------------------
     Reporter:  jerzyk      |      Owner:  nobody
         Type:  Bug         |     Status:  new
    Component:  Forms       |    Version:  1.8
     Severity:  Normal      |   Keywords:  bmp, image
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  0           |      UI/UX:  0
----------------------------+------------------------
 when assigning a .bmp (windows bitmap) image to an ImageField field,
 django reports error, responsible line, that raises an error is
 django/forms/fields.py:695 (to_python)

 {{{
 f.content_type = Image.MIME[image.format]
 }}}

 file is validated properly (opened, validated) and at the and, it's
 mime_type is detected by using a dictionary `Image.MIME`.

 This dictionary is not documented and does not contain entries for BMP
 file, so it may be assumed that Django is using it's private api.

 There are two options - push on Pillow to make this public API and fix an
 issue or use different method to find mime-type (e.g. python's standard
 mimetypes library)

--
Ticket URL: <https://code.djangoproject.com/ticket/24948>
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/049.515d5da920132bea6b5a4a0ebfe721a1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to