-
-
Notifications
You must be signed in to change notification settings - Fork 304
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
Upload Issue - No Resized Images Generated #153
Comments
Looks like I'm getting an IOerror in the create_thumbnail() function in models.py I had to add a print statement to be sure. It doesn't alert the user in any way when it happens. just returns. I'll update after more testing. |
OK. Figured it out. Therefore, if you try to upload a png and AVATAR_THUMB_FORMAT is set to 'JPEG', the image upload will fail silently with an IOError: cannot write mode RGBA as JPEG If the AVATAR_THUMB_FORMAT is set to 'PNG' everythings fine. Here is a link to the Pillow issue that helped me out with this. python-pillow/Pillow#2609 The alpha channel must first be removed to save the png as jpeg like so: The create_thumbnail() function in models.py will need to be edited to fix this |
Does that mean I have to decide if my users should upload jpg or png images? That would be inconvenient. I'm experiencing the same issues. But I'm generally using jpg - and the pngs are not created. |
I'm running django-avatar 4.1.0 |
Any update on this? Are we forced to make users choose one type of image format out of the box? Experiencing the same issue with 4.1.0 |
@Lone1567 I think we're just waiting for a PR on this one. |
submitted PR #180 |
I just encountered this problem too. |
Also encountered this issue. This project seems to be quite low on maintenance, with last merge being on 2020. |
When I upload a new avatar via http://127.0.0.1:8000/avatar/change/ it uploads successfully, however the resized images are not created and so the avatar images are not displayed.
The avatar image is uploaded to /media/avatars/paul/flame_350_vknNF9f.png
It's linking to /media/avatars/paul/resized/80/flame_350_vknNF9f.png and so returns a 404
The 'resized' and '80' directories do not exist.
I don't get any kind of traceback. This is what I get in the terminal:
Not Found: /media/avatars/paul/resized/80/flame_350_bGtZsFN.png
[01/Aug/2017 05:32:54] "GET /media/avatars/paul/resized/80/flame_350_bGtZsFN.png HTTP/1.1" 404 1880
I'm using python 3.5.3, Django 1.11.3, django-avatar 4.0.0, Pillow 4.2.1, ubuntu 17.04
The text was updated successfully, but these errors were encountered: