Code

Opened 9 months ago

Closed 9 months ago

Last modified 9 months ago

#20810 closed Bug (wontfix)

IOError raised when using EPS file in ImageField

Reported by: imatusov Owned by: nobody
Component: File uploads/storage Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When using EPS file in ImageField, I get IOError("decoder eps not availabe") traceback. However, there is support for EPS files in Python:

from PIL import Image
Image.open('mathematica.eps')

<PIL.EpsImagePlugin.EpsImageFile image mode=RGB size=288x177 at 0x1B01320>

Problem occurs when Django tries to determine the resolution of image. It uses low level API which allows to determine size after loading just couple of chunks. The way EPS support is implemented, API does not triggered it. Attached patch provides a fallback option to use standard Image API.

Attachments (1)

0001-Fix-PIL-bug-when-using-EPS-file-in-ImageField.patch (20.6 KB) - added by imatusov 9 months ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 9 months ago by timo

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

PIL has been deprecated in Django 1.6 in favor of Pillow. Could you check if this is an issue there?

comment:2 Changed 9 months ago by timo

  • Resolution set to wontfix
  • Status changed from new to closed

comment:3 Changed 9 months ago by claudep

@timo, could you just explain your "wontfix"? Did someone establish that this was not a problem with Pillow?

comment:4 Changed 9 months ago by timo

"Won't fix" the issue with PIL & "needs info" as to whether or not it's a problem with Pillow.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.