From c9027378a12a6f67b22ee5fe203df1739486e3ad Mon Sep 17 00:00:00 2001 From: Olaf Meeuwissen Date: Mon, 13 Jun 2016 20:35:34 +0900 Subject: [PATCH] xerox_mpf: Make JPEG support an option --- backend/xerox_mfp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/xerox_mfp.c b/backend/xerox_mfp.c index 7b220cb13..0b8844128 100644 --- a/backend/xerox_mfp.c +++ b/backend/xerox_mfp.c @@ -30,7 +30,9 @@ #include "../include/sane/sanei_usb.h" #include "../include/sane/sanei_config.h" #include "../include/sane/sanei_backend.h" +#ifdef HAVE_LIBJPEG #include +#endif #include "xerox_mfp.h" #define BACKEND_BUILD 13 @@ -92,6 +94,7 @@ const char *encTmpFileName = "/tmp/stmp_enc.tmp"; static int decompress(struct device *dev, const char *infilename) { +#ifdef HAVE_LIBJPEG int rc; int row_stride, width, height, pixel_size; struct jpeg_decompress_struct cinfo; @@ -140,6 +143,9 @@ static int decompress(struct device *dev, const char *infilename) jpeg_destroy_decompress(&cinfo); fclose(pInfile); return 0; +#else + return -1; +#endif } static int copy_decompress_data(struct device *dev, unsigned char *pDest, int maxlen, int *destLen) @@ -194,11 +200,15 @@ static int dump_to_tmp_file(struct device *dev) static int isSupportedDevice(struct device *dev) { +#ifdef HAVE_LIBJPEG /* Checking device which supports JPEG Lossy compression for color scanning*/ if ( dev->compressionTypes & (1 << 6) ) return 1; else return 0; +#else + return 0; +#endif } static void dbg_dump(struct device *dev)