-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImageWidget depends on having image decoder installed. #2
Comments
Yes, this is not ideal. I'm not sure what would be a good way to reliably identify image values that wouldn't suffer from this problem; if you have a proposal (and better, a patch!) I'd welcome it. |
Hi,
|
We access those attributes simply as a way of determining whether |
I'm working with django-storages using S3. Apparently, the width/height will always be fetched and is described in this ticket: https://code.djangoproject.com/ticket/8307 . As a result, it has to read the file to get the up to date weight/height and will be slow for cloud based storages. A similar issue on SO: http://stackoverflow.com/questions/5877497/storing-images-and-thumbnails-on-s3-in-django Since I'm working on the ImageField, should I override this on my own widget to prevent the extra hit on S3? |
I don't know what you should do in that case, I haven't worked with Regarding this specific bug, I'd welcome proposals of an alternative way to reliably tell whether |
I can take a look next week, but if anyone else wants to take shot? Sent from my iPhone 4S On Apr 12, 2013, at 10:26 AM, Carl Meyer [email protected] wrote: I don't know what you should do in that case, I haven't worked with Regarding this specific bug, I'd welcome proposals of an alternative way to — |
In the ImageWidget code, there is a line that checks whether
value
is an image:This works great unless you don't have decoders that PIL needs for a specific file type.
For example:
If you store a JPEG image in your model but have no need to process it (no decoder or django-thumbnail-app is installed) then when that line runs PIL will throw and catch an IO error, causing the line to interpret as
False
This means it will render only the file upload input and not the image.I find that to be unexpected behavior if I have no need for image processing.
The text was updated successfully, but these errors were encountered: