Skip to content

Commit

Permalink
Merge branch 'develop' into ejh_more_jasper
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett authored Oct 2, 2023
2 parents f03f812 + 4d05d0c commit 903a677
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/Spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ jobs:
# Run 'spack load' to check for obvious errors in setup_run_environment
spack load g2
- name: Upload test results
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: spackci-ctest-output-${{ matrix.os }}-${{ matrix.pic }}-${{ matrix.precision }}-${{ matrix.w3emc }}
path: ${{ github.workspace }}/g2/spack-build-*/Testing/Temporary/LastTest.log


# This job validates the Spack recipe by making sure each cmake build option is represented
recipe-check:
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions src/dec_jpeg2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,18 @@ int_dec_jpeg2000(char *injpc, g2int bufsize, void *outfld, int out_is_g2int)
char *opts = NULL;
jas_matrix_t *data;
int fmt;
char *g2jaspermaxmem;

/* Initialize Jasper. */
#ifdef JASPER3
jas_conf_clear();
/* static jas_std_allocator_t allocator; */
/* jas_std_allocator_init(&allocator); */
/* jas_conf_set_allocator(JAS_CAST(jas_std_allocator_t *, &allocator)); */
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_multithread(true);
jas_conf_set_max_mem_usage(G2C_JASPER_MAX_MEMORY);
if (jas_init_library())
Expand Down
8 changes: 8 additions & 0 deletions src/enc_jpeg2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits,
jas_image_cmpt_t cmpt, *pcmpt;
char opts[MAXOPTSSIZE];
int fmt;
char *g2jaspermaxmem;

/* Set lossy compression options, if requested. */
if (ltype != 1)
Expand Down Expand Up @@ -137,6 +138,13 @@ enc_jpeg2000(unsigned char *cin, g2int width, g2int height, g2int nbits,
#ifdef JASPER3
jas_conf_clear();
jas_conf_set_max_mem_usage(G2C_JASPER_MAX_MEMORY);
/* static jas_std_allocator_t allocator; */
/* jas_std_allocator_init(&allocator); */
/* jas_conf_set_allocator(JAS_CAST(jas_std_allocator_t *, &allocator)); */
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_multithread(true);
if (jas_init_library())
return G2_JASPER_INIT;
Expand Down
6 changes: 6 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ foreach(kind ${kinds})
if (BUILD_WITH_W3EMC)
create_test(test_gdt2gds ${kind})
endif()

if (${kind} EQUAL "4")
# Add this script to ensure that jasper is not issuing warnings.
gu_test(run_jasper_warning_test)
set_tests_properties(run_jasper_warning_test.sh PROPERTIES LABELS noMemcheck)
endif()
endforeach()

# Add this script to ensure that jasper is not issuing warnings.
Expand Down
5 changes: 4 additions & 1 deletion tests/run_jasper_warning_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ echo "*** Running jasper warning test"
set -x

# Run the test and capture output.
../tests/test_jpcpack_4 &> test_jpcpack_4_output.txt
pwd
ls -l
#ls -l test_jpcpack_4
./test_jpcpack_4 &> test_jpcpack_4_output.txt
cat test_jpcpack_4_output.txt

# Check against expected output.
Expand Down

0 comments on commit 903a677

Please sign in to comment.