mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-09-24 13:07:00 +03:00
FLI/FLC _accept: Check for 8-bit colour depth
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.
This commit is contained in:
parent
9f5d1f71a0
commit
583c33c9f7
Binary file not shown.
Binary file not shown.
|
@ -32,6 +32,7 @@ def _accept(prefix: bytes) -> bool:
|
||||||
return (
|
return (
|
||||||
len(prefix) >= 6
|
len(prefix) >= 6
|
||||||
and i16(prefix, 4) in [0xAF11, 0xAF12]
|
and i16(prefix, 4) in [0xAF11, 0xAF12]
|
||||||
|
and i16(prefix, 12) == 8 # 8-bit colour
|
||||||
and i16(prefix, 14) in [0, 3] # flags
|
and i16(prefix, 14) in [0, 3] # flags
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user