Skip to content

Replaced tiff_jpeg with jpeg compression when saving TIFF images#4627

Merged
hugovk merged 1 commit intopython-pillow:masterfrom
radarhere:tiff_jpeg
Jun 20, 2020
Merged

Replaced tiff_jpeg with jpeg compression when saving TIFF images#4627
hugovk merged 1 commit intopython-pillow:masterfrom
radarhere:tiff_jpeg

Conversation

@radarhere
Copy link
Copy Markdown
Member

Resolves #3786

In this issue, the user opens an image with 'tiff_jpeg' compression, and then tries to save it. libtiff throws an error though - 'OJPEGSetupEncode: OJPEG encoding not supported; use new-style JPEG compression instead.'

For a longer explanation of this error message, see the text at the beginning of the libtiff file that contains the error - https://gitlab.com/libtiff/libtiff/-/blob/master/libtiff/tif_ojpeg.c

According to https://www.awaresystems.be/imaging/tiff/tifftags/compression.html - 6 is old-style JPEG (Pillow tiff_jpeg compression), 7 is new-style JPEG (Pillow jpeg compression).

So this PR takes the advice from libtiff, and changes from 'tiff_jpeg' to 'jpeg' when saving.

@radarhere radarhere added the TIFF label May 15, 2020
@radarhere radarhere changed the title Switch from tiff_jpeg to jpeg compresion when saving TIFF images Replaced tiff_jpeg with jpeg compression when saving TIFF images May 15, 2020
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 this pull request may close these issues.

Manipulating .cr2 file crashes Python process (signal 11)

2 participants