From: Bastian Dehn Date: Tue, 5 May 2026 06:52:38 +0000 (+0200) Subject: add define ppm and pbm sig X-Git-Tag: v1.1.30^2~14 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=b0dd8d9c32f87e15ba00aca4bc861783cb6426e3;p=sane-kds-s2000w-net.git add define ppm and pbm sig --- diff --git a/src/kds_s2000w_image_type_check.c b/src/kds_s2000w_image_type_check.c index f05820c..046ab01 100644 --- a/src/kds_s2000w_image_type_check.c +++ b/src/kds_s2000w_image_type_check.c @@ -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)