FLI/FLC _accept: Check for 8-bit colour depth#9169
FLI/FLC _accept: Check for 8-bit colour depth#9169vpv-csc wants to merge 1 commit intopython-pillow:mainfrom
Conversation
Standard FLI/FLC files always have 8-bit color depth. This change helps avoid erroneously detecting some TIFFs as FLI/FLC files. Update test files Tests/images/timeout-9139147ce93e20eb14088fe238e541443ffd64b3.fli and Tests/images/timeout-bff0a9dc7243a8e6ede2408d2ffa6a9964698b87.fli to claim to have 8-bit colour depth so that the tests related to them will still work.
cd6114e to
583c33c
Compare
|
Just to link to documentation, https://www.fileformat.info/format/fli/egff.htm describes the header as |
|
Under 'Frequent errors', https://www.compuphase.com/flic.htm lists 'The colour depth is set to zero'. Is it worth also accepting zero as the value? |
| return ( | ||
| len(prefix) >= 6 | ||
| and i16(prefix, 4) in [0xAF11, 0xAF12] | ||
| and i16(prefix, 12) == 8 # 8-bit colour |
There was a problem hiding this comment.
| and i16(prefix, 12) == 8 # 8-bit colour | |
| and i16(prefix, 12) == [0, 8] # depth |
The We have received two ”false positive” TIFFs from our users. One of them has |
|
I've created #9183 to also help the issue. If you don't feel that changing |
|
I concentrated too much on |
|
#9183 has been merged. |
Fixes #9168 .
Changes proposed in this pull request: