Skip to content

Commit

Permalink
adding preprocessor constant for max memory for jasper (#562)
Browse files Browse the repository at this point in the history
* took out rest of setting of max memory for jasper

* restored jasper max memory

* added test for jasper warnings

* added test for jasper warnings

* comment

* fixing

* fixing

* improve documentation

* fixed workflow with -DBUILD_WITH_EXTRA_DEPS=ON
  • Loading branch information
edwardhartnett authored Oct 2, 2023
1 parent 4d05d0c commit e30b0c9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/grib_utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
cd w3emc
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH=~/bacio -DCMAKE_INSTALL_PREFIX=~/w3emc -DBUILD_WITH_BUFR=OFF ..
cmake -DCMAKE_PREFIX_PATH=~/bacio -DCMAKE_INSTALL_PREFIX=~/w3emc -DBUILD_WITH_BUFR=OFF -DBUILD_WITH_EXTRA_DEPS=ON ..
make -j2
make install
Expand Down
2 changes: 1 addition & 1 deletion src/dec_jpeg2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int_dec_jpeg2000(char *injpc, g2int bufsize, void *outfld, int out_is_g2int)
if (( g2jaspermaxmem = getenv("G2_JASPER_MAXMEM")) != NULL )
jas_conf_set_max_mem_usage(atoi(g2jaspermaxmem));
else
jas_conf_set_max_mem_usage(1073741824);
jas_conf_set_max_mem_usage(G2C_JASPER_MAX_MEMORY);
jas_conf_set_multithread(true);
if (jas_init_library())
return G2_JASPER_INIT;
Expand Down
2 changes: 1 addition & 1 deletion src/enc_jpeg2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits,
if (( g2jaspermaxmem = getenv("G2_JASPER_MAXMEM")) != NULL )
jas_conf_set_max_mem_usage(atoi(g2jaspermaxmem));
else
jas_conf_set_max_mem_usage(1073741824);
jas_conf_set_max_mem_usage(G2C_JASPER_MAX_MEMORY);
jas_conf_set_multithread(true);
if (jas_init_library())
return G2_JASPER_INIT;
Expand Down
5 changes: 5 additions & 0 deletions src/jpeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ typedef float g2float;

/** Name of JPEG codec in Jasper. */
#define G2C_JASPER_JPEG_FORMAT_NAME "jpc"

/** Max memory size setting for Jasper. This can be over-ridden at
* run-time by setting environment variable G2_JASPER_MAXMEM. */
#define G2C_JASPER_MAX_MEMORY 1073741824

0 comments on commit e30b0c9

Please sign in to comment.