mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-07-18 20:04:16 -04:00
tga: Be less strict about palette
There's images in the wild that claim to not have a palette but still have one.
This commit is contained in:
committed by
Mirco Miranda
parent
aef4bd7e1c
commit
21b3b890ec
@ -119,10 +119,11 @@ static bool IsSupported(const TgaHeader &head)
|
|||||||
if (head.pixel_size != 8 && head.pixel_size != 16 && head.pixel_size != 24 && head.pixel_size != 32) {
|
if (head.pixel_size != 8 && head.pixel_size != 16 && head.pixel_size != 24 && head.pixel_size != 32) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// If the colormap_type field is set to zero, indicating that no color map exists, then colormap_size, colormap_index and colormap_length should be set to zero.
|
// If the colormap_type field is set to zero, indicating that no color map exists, then colormap_index and colormap_length should be set to zero.
|
||||||
if (head.colormap_type == 0 && (head.colormap_size != 0 || head.colormap_index != 0 || head.colormap_length != 0)) {
|
if (head.colormap_type == 0 && (head.colormap_index != 0 || head.colormap_length != 0)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user