diff --git a/CHANGES b/CHANGES index 059918e9..341177a0 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ What's New for OpenJPEG + : added November 9, 2011 +* [mickael] WIP: fix get_decoded_tile function to avoid error with output image * [mickael] fix bug with mj2 applications (credit to winfried) + [mickael] enhance mj2 when read jp2h (credit to winfried) + [mickael] check if the file extension is the same as the infile format (credit to winfried) diff --git a/libopenjpeg/j2k.c b/libopenjpeg/j2k.c index 281b087f..379f8bee 100644 --- a/libopenjpeg/j2k.c +++ b/libopenjpeg/j2k.c @@ -8376,9 +8376,18 @@ opj_bool j2k_get_tile( opj_j2k_v2_t *p_j2k, l_tile_y = tile_index / p_j2k->m_cp.tw; p_image->x0 = l_tile_x * p_j2k->m_cp.tdx + p_j2k->m_cp.tx0; + if (p_image->x0 < p_j2k->m_private_image->x0) + p_image->x0 = p_j2k->m_private_image->x0; p_image->x1 = (l_tile_x + 1) * p_j2k->m_cp.tdx + p_j2k->m_cp.tx0; + if (p_image->x1 > p_j2k->m_private_image->x1) + p_image->x1 = p_j2k->m_private_image->x1; + p_image->y0 = l_tile_y * p_j2k->m_cp.tdy + p_j2k->m_cp.ty0; + if (p_image->y0 < p_j2k->m_private_image->y0) + p_image->y0 = p_j2k->m_private_image->y0; p_image->y1 = (l_tile_y + 1) * p_j2k->m_cp.tdy + p_j2k->m_cp.ty0; + if (p_image->y1 > p_j2k->m_private_image->y1) + p_image->y1 = p_j2k->m_private_image->y1; l_img_comp = p_image->comps; for (compno=0; compno < p_image->numcomps; ++compno) diff --git a/tests/nonregression/CMakeLists.txt b/tests/nonregression/CMakeLists.txt index ec100e42..8d63f7e2 100644 --- a/tests/nonregression/CMakeLists.txt +++ b/tests/nonregression/CMakeLists.txt @@ -96,7 +96,7 @@ IF (TEST_SUITE_FILES) # Avoid to process the official test suite SET(FILE_ALREADY_READ 0) - STRING(REGEX MATCH "test_suite.ctest.in$" FILE_ALREADY_READ ${TEST_SUITE_FILE}) + STRING(REGEX MATCH "^test_suite.ctest.in$" FILE_ALREADY_READ ${TEST_SUITE_FILE}) IF(NOT FILE_ALREADY_READ) # Configure the additional test suite file: