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

Recent change in TIFF rows per strip break saving with JPEG compression #5586

Closed
manthey opened this issue Jul 6, 2021 · 2 comments · Fixed by #5588
Closed

Recent change in TIFF rows per strip break saving with JPEG compression #5586

manthey opened this issue Jul 6, 2021 · 2 comments · Fixed by #5588
Labels

Comments

@manthey
Copy link

manthey commented Jul 6, 2021

What did you do?

Tried to save an image with TIFF JPEG compression.

What did you expect to happen?

It to create a file.

What actually happened?

It threw OSError: encoder error -2 when writing image file. More specifically, I see JPEGSetupEncode: RowsPerStrip must be multiple of 8 for JPEG..

What are your OS, Python and Pillow versions?

  • OS: Ubuntu 20.04
  • Python: 3.9
  • Pillow: 8.3.0
import PIL.Image
image = PIL.Image.new('RGB', (1760, 1046))
image.save('/tmp/junk.tiff', compression='tiff_jpeg')

The error was specifically introduced in https://github.com/python-pillow/Pillow/pull/5514/files#diff-6ad43f85f1a075181d4d8cfcd97ae27bba1eccf5c3db5a3457160f98218eba6eR1562-R1565

@kmilos
Copy link
Contributor

kmilos commented Jul 6, 2021

I get the same error in 8.2.0 when writing as a single strip, 1046 is not a multiple of 8 either...

The problem was always there, however now more likely to pop up...

Sorry, works as single strip in 8.2.0, had local changes...

@radarhere radarhere added the TIFF label Jul 7, 2021
@radarhere radarhere changed the title Recent change in tiff rows per strip break saving with jpeg compression Recent change in TIFF rows per strip break saving with JPEG compression Jul 7, 2021
@radarhere
Copy link
Member

Pillow 8.3.2 has just been released with the fix for this.

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

Successfully merging a pull request may close this issue.

3 participants