From b0dd8d9c32f87e15ba00aca4bc861783cb6426e3 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Tue, 5 May 2026 08:52:38 +0200 Subject: [PATCH] add define ppm and pbm sig --- src/kds_s2000w_image_type_check.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) -- 2.47.3