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

IOError: cannot write mode RGBA as JPEG #28

Closed
liuxue0905 opened this issue Sep 11, 2017 · 16 comments
Closed

IOError: cannot write mode RGBA as JPEG #28

liuxue0905 opened this issue Sep 11, 2017 · 16 comments
Milestone

Comments

@liuxue0905
Copy link

liuxue0905 commented Sep 11, 2017

watermark is 'watermarks/mark.png', mark.png is same as sorl-watermark/tests

no matter my picture on web page is jpeg or png

Request Method: | GET
-- | --
http://localhost:8888/portal/records/
1.11.3
IOError
cannot write mode RGBA as JPEG
/usr/local/lib/python2.7/site-packages/PIL/JpegImagePlugin.py in _save, line 604
/usr/local/opt/python/bin/python2.7
2.7.13
['/Users/liuxue/PycharmProjects/GoldenTimes',  '/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',  '/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7',  '/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',  '/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',  '/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',  '/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',  '/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',  '/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',  '/usr/local/lib/python2.7/site-packages',  '/usr/local/lib/python2.7/site-packages/onvif-0.1.3-py2.7.egg',  '/usr/local/lib/python2.7/site-packages/WSDiscovery-0.2-py2.7.egg',  '/usr/local/Cellar/numpy/1.13.0/libexec/nose/lib/python2.7/site-packages']
Mon, 11 Sep 2017 01:23:11 +0000
@lampslave
Copy link

python-pillow/Pillow#2609

@liuxue0905
Copy link
Author

Problem of Pillow 4.2

$ pip install "Pillow<4.2"

@liuxue0905
Copy link
Author

I try sorl-watermark, i think it's better than django-watermark.

@killown
Copy link

killown commented Mar 8, 2018

not fixed yet?

@originell
Copy link
Owner

@killown what is your Pillow version?

@developer-mayuan
Copy link

I have the same error using Pillow 5.0

@originell
Copy link
Owner

Ah. I don't yet use Pillow 5 in any production environment. Sadly, I don't have time to look at this in the coming days. But I'll schedule some time next week.

@originell originell reopened this Mar 27, 2018
@vbazhin
Copy link
Collaborator

vbazhin commented Mar 27, 2018

Hi @originell :)
I'm here too, and possibly I'll have some time on Sunday to look at this, but not sure yet.

@originell
Copy link
Owner

@vbazhin Awesome! If you find the time test that, let me know. Otherwise I will just try to schedule an hour or so next week.

@vbazhin
Copy link
Collaborator

vbazhin commented Apr 1, 2018

Hi @originell . I had a short time to investigate this tonight.
The tests pass on my end for py2.7+django1.10+Pillow5 and py3.4+django1.10+Pillow5.
I couldn't reproduce the problem so far.
Just a rough presumption: maybe, the behavior may vary depending on different libjpeg versions?

@originell
Copy link
Owner

Thanks for testing this! maybe! @developer-mayuan can you tell us which libjpeg version you are using?

@emacsway
Copy link

I've the same problem with Pillow==5.1.0

@emacsway
Copy link

there is a workaround biz-tek-dev@e587a61

@originell
Copy link
Owner

originell commented Jun 12, 2018

Good catch @emacsway .. @vbazhin do you have time to integrate this? BUT we shouldn't simply convert to RGB without first checking that we are processing an RGB image (JPG)

@emacsway
Copy link

BUT we shouldn't simply convert to RGB without first checking that we are processing an RGB image (JPG)

Oh, you are right, thanks.

@originell
Copy link
Owner

@emacsway I finally got around to take care of this ;-) see the mentioned commit. this should now be fixed.

@originell originell added this to the 1.1 milestone Jan 13, 2019
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

7 participants