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

Can't save JPEG2000 to a BytesIO object #1945

Closed
CSNE opened this issue Jun 11, 2016 · 6 comments
Closed

Can't save JPEG2000 to a BytesIO object #1945

CSNE opened this issue Jun 11, 2016 · 6 comments

Comments

@CSNE
Copy link

CSNE commented Jun 11, 2016

What did you do?

I tried to save a JPEG2000 image into a BytesIO object.

What did you expect to happen?

It should have saved the image file into the BytesIO object.

What actually happened?

The script fails("python.exe has stopped working").

What versions of Pillow and Python are you using?

Python 3.3.4 (32-bit) and Pillow 3.2.0
I also tried using Python 3.5.1, but the script still fails.

from PIL import Image
from io import BytesIO

#Any image will reproduce the bug.
img=Image.open(r"some-image.png")

print("Saving ordinary JPEG to a BytesIO object. This works fine.")
bio=BytesIO()
img.save(bio,"JPEG")

print("Saving JPEG2000 to a file. This also works fine.")
img.save(r"some-other-image.jpf","JPEG2000")

print("Saving JPEG2000 to a BytesIO object. This fails.")
bio2=BytesIO()
img.save(bio2,"JPEG2000")
@wiredfool
Copy link
Member

Is this Windows? And is it a crash or a exception?

@CSNE
Copy link
Author

CSNE commented Jun 11, 2016

I'm using Windows 8.1.
When I run the script, no traceback is printed in the console, but a Windows dialog pops up saying "python.exe has stopped working.". So I guess it's a crash.
capture12

@wiredfool
Copy link
Member

That's a crash, and it's odd. Our roundtrip tests for J2k use bytesio, so that should be the most well tested configuration. On the other hand, we don't have that configuration in ci, so it's possible something is wrong.

@CSNE
Copy link
Author

CSNE commented Jun 13, 2016

Update: Just tried running the script on two of my friend's computers(one Windows 7 w/ Python 3.5 and one Windows 8.1 w/ Python 3.5). They don't crash.
Perhaps it was just my machine.

@wiredfool
Copy link
Member

It does seem that way. You could have some corruption in the pillow or the python install which might be fixed by reinstalling.

@CSNE
Copy link
Author

CSNE commented Jun 15, 2016

Reinstalling doesn't help, might be something wrong in the system.
Anyways, thanks!

@CSNE CSNE closed this as completed Jun 15, 2016
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