swap only if 16 or 32 bits, otherwise endianness has no meaningwq

This commit is contained in:
Riccardo Mottola 2024-05-09 01:17:01 +02:00
parent f77370178a
commit 22dbbbb1f6

View file

@ -540,7 +540,8 @@ NSTiffWrite(TIFF *image, NSTiffInfo *info, unsigned char *data)
scan_line_size = TIFFScanlineSize(image);
// check if image endianness is different from Host
if ((info->isBigEndian != 0) != (NSHostByteOrder() == NS_BigEndian))
if ((info->isBigEndian != 0) != (NSHostByteOrder() == NS_BigEndian) &&
(info->is16Bit || info->is32Bit))
{
swapByteOrder = YES;
}