]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add type check tiff mm byte order
authorBastian Dehn <hhaalo@arcor.de>
Sun, 26 Jan 2025 18:39:15 +0000 (19:39 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 26 Jan 2025 18:39:15 +0000 (19:39 +0100)
src/kds_s2000w_image_type_check.c

index e2989d49d4c78c00278792d965d1b48d786321c9..ed5957d30b14ac2e5e2dd619391edafc873da618 100644 (file)
@@ -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)