-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
FLI/FLC _accept: Check for 8-bit colour depth #9169
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
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Fixes #9168 .
Changes proposed in this pull request: