From 3fb11b3348b236ff7ee7dad43f98df304e9eb842 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 28 Nov 2022 18:17:03 +0000 Subject: [PATCH] ECC-1477: Compilation fails with libjasper v4.x.x --- src/grib_jasper_encoding.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/grib_jasper_encoding.c b/src/grib_jasper_encoding.c index fe8facf92..d51c57147 100644 --- a/src/grib_jasper_encoding.c +++ b/src/grib_jasper_encoding.c @@ -22,7 +22,7 @@ static int ecc_jasper_initialise() { -#if JASPER_VERSION_MAJOR == 3 +#if JASPER_VERSION_MAJOR >= 3 int jaserr = 0; jas_conf_clear(); jas_conf_set_max_mem_usage(jas_get_total_mem_size()); @@ -36,7 +36,7 @@ static int ecc_jasper_initialise() static jas_image_t* ecc_jasper_decode(jas_stream_t *in) { -#if JASPER_VERSION_MAJOR == 3 +#if JASPER_VERSION_MAJOR >= 3 /* Second argument (=fmt) < 0 means "If possible, try to determine the format of the input data" */ return jas_image_decode(in, -1, 0); #else @@ -46,7 +46,7 @@ static jas_image_t* ecc_jasper_decode(jas_stream_t *in) static int ecc_jasper_encode(jas_image_t *image, jas_stream_t *jpcstream, char *optstr) { -#if JASPER_VERSION_MAJOR == 3 +#if JASPER_VERSION_MAJOR >= 3 const int fmt = jas_image_strtofmt("jpc"); return jas_image_encode(image, jpcstream, fmt, optstr); #else @@ -56,7 +56,7 @@ static int ecc_jasper_encode(jas_image_t *image, jas_stream_t *jpcstream, char * static void ecc_jasper_cleanup() { -#if JASPER_VERSION_MAJOR == 3 +#if JASPER_VERSION_MAJOR >= 3 jas_cleanup_thread(); jas_cleanup_library(); #endif