IOError raised when using EPS file in ImageField
|Reported by:||imatusov||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
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
<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.