From: Bastian Dehn Date: Sun, 26 Jan 2025 18:39:15 +0000 (+0100) Subject: add type check tiff mm byte order X-Git-Tag: v1.0.29^2~3^2~18 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=306f0436daf1fe4c89c1ecc9545bd801f72ebb6f;p=sane-kds-s2000w-net.git add type check tiff mm byte order --- diff --git a/src/kds_s2000w_image_type_check.c b/src/kds_s2000w_image_type_check.c index e2989d4..ed5957d 100644 --- a/src/kds_s2000w_image_type_check.c +++ b/src/kds_s2000w_image_type_check.c @@ -14,7 +14,15 @@ int kds_s2000w_image_type_check_is_tiff(blobdata* image) int result = image_data[0] == (char)0x49; result = result && image_data[1] == (char)0x49; result = result && image_data[2] == (char)0x2A; - return result && image_data[3] == (char)0x00; + result = result && image_data[3] == (char)0x00; + + if (result == 1) + return result; + + result = image_data[0] == (char)0x4d; + result = result && image_data[1] == (char)0x4d; + result = result && image_data[2] == (char)0x00; + return result && image_data[3] == (char)0x2A; } int kds_s2000w_image_type_check_is_pnm(blobdata* image)