Skip to content

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

@manthey

Description

@manthey

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions