]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add define ppm and pbm sig
authorBastian Dehn <hhaalo@arcor.de>
Tue, 5 May 2026 06:52:38 +0000 (08:52 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 5 May 2026 06:52:38 +0000 (08:52 +0200)
src/kds_s2000w_image_type_check.c

index f05820c0c494c83338bf8ce3f2172ce3e62df1ae..046ab0162770016ff62ba149b53b9bff94e240f5 100644 (file)
@@ -5,6 +5,8 @@
 #define TIFF_SIG_LEN 4
 #define PNM_SIG_LEN 2
 #define JPEG_SIG_LEN 2
+#define PBM_SIG "P4"
+#define PPM_SIG "P6"
 
 bool kds_s2000w_image_type_check_is_tiff(const blobdata_t* image)
 {
@@ -20,8 +22,8 @@ bool kds_s2000w_image_type_check_is_pnm(const blobdata_t* image)
        if (image->size < PNM_SIG_LEN)
                return false;
 
-       return memcmp(image->data, "P4", PNM_SIG_LEN) == 0
-               || memcmp(image->data, "P6", PNM_SIG_LEN) == 0;
+       return memcmp(image->data, PBM_SIG, PNM_SIG_LEN) == 0
+               || memcmp(image->data, PPM_SIG, PNM_SIG_LEN) == 0;
 }
 
 bool kds_s2000w_image_type_check_is_jpeg(const blobdata_t* image)