Skip to content
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

Cannot write mode RGBA as JPEG #182

Closed
denning opened this issue Jan 27, 2018 · 5 comments
Closed

Cannot write mode RGBA as JPEG #182

denning opened this issue Jan 27, 2018 · 5 comments

Comments

@denning
Copy link

denning commented Jan 27, 2018

Related to python-pillow/Pillow#2609 ?

What happened:

System Info:

  • Python 3.6.3
  • Django 2.0.1
  • Photologue 3.8.1
  • Pillow 5.0.0

Error Message:

Internal Server Error: /admin/photologue/watermark/add/
OSError at /admin/photologue/watermark/add/
cannot write mode RGBA as JPEG
...
File "/home/dylan/.virtualenvs/project/lib/python3.5/site-packages/PIL/JpegImagePlugin.py" in _save
605.         rawmode = RAWMODE[im.mode]
@richardbarran
Copy link
Owner

I've just pushed a commit to the master branch with a possible fix - could you try it out please and let me know if it works?

@denning
Copy link
Author

denning commented Jan 29, 2018

Wow thanks for quick response!! 👍 👍

Steps taken

Traceback (truncated)

File "/home/dylan/.virtualenvs/project/lib/python3.5/site-packages/PIL/JpegImagePlugin.py" in _save
  605.         rawmode = RAWMODE[im.mode]

...

File "/home/dylan/.virtualenvs/project/lib/python3.5/site-packages/django/contrib/admin/options.py" in save_model
  1026.         obj.save()

File "/home/dylan/.virtualenvs/project/lib/python3.5/site-packages/photologue/models.py" in save
  839.         self.clear_cache()

File "/home/dylan/.virtualenvs/project/lib/python3.5/site-packages/photologue/models.py" in clear_cache
  827.                     obj.create_size(self)

File "/home/dylan/.virtualenvs/project/lib/python3.5/site-packages/photologue/models.py" in create_size
  439.             raise e

File "/home/dylan/.virtualenvs/project/lib/python3.5/site-packages/photologue/models.py" in create_size
  433.                         optimize=True)

File "/home/dylan/.virtualenvs/project/lib/python3.5/site-packages/PIL/Image.py" in save
  1930.             save_handler(self, fp, filename)

File "/home/dylan/.virtualenvs/project/lib/python3.5/site-packages/PIL/JpegImagePlugin.py" in _save
  607.         raise IOError("cannot write mode %s as JPEG" % im.mode)

@richardbarran
Copy link
Owner

Hi - sorry for taking a long time to get back to you. I've pushed another commit to the master branch which fixes the second issue that you reported - well, it fixes it for me!
Can you try it out please?

@denning
Copy link
Author

denning commented Mar 12, 2018

[Edited after uninstalling and reinstalling patch to server.]

Thank you!!!! Tested on local and remote servers - worked perfectly.

So sorry for the long delay! Once again, thank you so much for your work! 👍

@denning denning closed this as completed Mar 12, 2018
@richardbarran
Copy link
Owner

Great to hear that this issue has been fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants