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
InvalidImageFormatError: The source file does not appear to be an image #290
Comments
In my experience, this error is produced for about everything including permission denied, file not found, PIL not working. |
Yes, see #221 on making this better. |
Opening it from PIL in the django shell inside my virtualenv works just fine.
I'm more concerned that the thumbnail tag isn't even able to load 3rd party images like when I do
|
@robpodosek did you find the problem? |
#259 is tracking being able to load thumbnails from a URL (it's not a very efficient thing to do, but should be able to be implemented without that much fuss) |
@robpodosek what was the problem? I'm having a similar issue. |
@robpodosek Any hints on solving this? I'm having the same issue right now. |
This error should be silenced. It breaks the entire page, if an image has some form of damage or is incorrect. Instead, you should display a warning text or something similar. But breaking the entire page is too much for a simple error like this.... |
And the error appears for different reason. The basic reason is, easy thumbnails have problems processing the image. That could have many reasons. I just find, raising a page-breaking error is not the solution to this. They need to silence it and let the user know, whats wrong with the image. |
This happens to me as well, and is taking down the entire site with 2m monthly views. There should be a fallback image to avoid error 500. |
The exact same things are happening to me. Thanks in advance. |
@MaykelLlanes could you please send me that image (if you can/use my private email) and tell me how you upload and access it. You are using a templatetag ( |
Thanks @jrief for the quick reply |
Could you please send me that image so that I can test in my environment. Maybe PIL is unable to convert CR01-71.jpg to WEBP? |
The problem was the following, for the default filter to take the value the previous expression must be evaluated to False, for this reason it explodes, because there is no image, the thumbnailer cannot create the object, the solution is to make another filter to check if the image exists in the storage, and return a boolean value.
Thanks. |
I recently had a similar issue, and i thought I'd share how i resolved my issue. Easy thumbnails uses |
I'm getting the following error when trying to output a thumbnail in my Django template:
This is happening with both JPEGs and PNGs. Here's how my template looks:
I have
THUMBNAIL_DEBUG = True
in my settings file andeasy_thumbnails
added to my installed apps.In my requirements.txt:
And before people say I don't have png/jpeg support with Pillow/PIL here's a
pip install -r requirements.txt
:So JPEG and PNG support are available. I'm also able to access the uploaded image from the browser by pointing to it's MEDIA_URL path. What gives?
edit:
I also get the same error when trying to load a 3rd party image such as
The text was updated successfully, but these errors were encountered: