Skip to content

Fix incorrect TIFF SAVE_INFO.#1045

Closed
anntzer wants to merge 1 commit intopython-pillow:masterfrom
anntzer:tiff-save-info
Closed

Fix incorrect TIFF SAVE_INFO.#1045
anntzer wants to merge 1 commit intopython-pillow:masterfrom
anntzer:tiff-save-info

Conversation

@anntzer
Copy link
Contributor

@anntzer anntzer commented Dec 9, 2014

Fix #1039.

@wiredfool
Copy link
Member

Looking at the spec, my earlier interpretation doesn't appear to be correct:

ExtraSamples

Description of extra components.

Tag = 338 (152.H)
Type = SHORT
N = m

Specifies that each pixel has m extra components whose interpretation is defined
by one of the values listed below. When this field is used, the SamplesPerPixel
field has a value greater than the PhotometricInterpretation field suggests.
For example, full-color RGB data normally has SamplesPerPixel=3. If
SamplesPerPixel is greater than 3, then the ExtraSamples field describes the
meaning of the extra samples. If SamplesPerPixel is, say, 5 then ExtraSamples
will contain 2 values, one for each extra sample.

ExtraSamples is typically used to include non-color information, such as opacity,
in an image. The possible values for each item in the field's value are:

0 = Unspecified data
1 = Associated alpha data (with pre-multiplied color)
2 = Unassociated alpha data

By this spec, the values are correct as they currently are. That doesn't explain your original problem in #1039 .

@hugovk hugovk closed this Dec 28, 2014
@anntzer anntzer deleted the tiff-save-info branch June 10, 2022 08:42
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

Successfully merging this pull request may close these issues.

PIL fails to roundtrip some TIFF images

3 participants