diff --git a/src/bin/common/color.c b/src/bin/common/color.c index 5024ac9e..a9b5e0c7 100644 --- a/src/bin/common/color.c +++ b/src/bin/common/color.c @@ -150,8 +150,13 @@ static void sycc422_to_rgb(opj_image_t *img) free(img->comps[1].data); img->comps[1].data = d1; free(img->comps[2].data); img->comps[2].data = d2; +#if defined(USE_JPWL) || defined(USE_MJ2) + img->comps[1].w = maxw; img->comps[1].h = maxh; + img->comps[2].w = maxw; img->comps[2].h = maxh; +#else img->comps[1].w = (OPJ_UINT32)maxw; img->comps[1].h = (OPJ_UINT32)maxh; img->comps[2].w = (OPJ_UINT32)maxw; img->comps[2].h = (OPJ_UINT32)maxh; +#endif img->comps[1].dx = img->comps[0].dx; img->comps[2].dx = img->comps[0].dx; img->comps[1].dy = img->comps[0].dy; @@ -209,8 +214,13 @@ static void sycc420_to_rgb(opj_image_t *img) free(img->comps[1].data); img->comps[1].data = d1; free(img->comps[2].data); img->comps[2].data = d2; +#if defined(USE_JPWL) || defined(USE_MJ2) + img->comps[1].w = maxw; img->comps[1].h = maxh; + img->comps[2].w = maxw; img->comps[2].h = maxh; +#else img->comps[1].w = (OPJ_UINT32)maxw; img->comps[1].h = (OPJ_UINT32)maxh; img->comps[2].w = (OPJ_UINT32)maxw; img->comps[2].h = (OPJ_UINT32)maxh; +#endif img->comps[1].dx = img->comps[0].dx; img->comps[2].dx = img->comps[0].dx; img->comps[1].dy = img->comps[0].dy; diff --git a/src/bin/mj2/CMakeLists.txt b/src/bin/mj2/CMakeLists.txt index e6b005b6..78ad7543 100644 --- a/src/bin/mj2/CMakeLists.txt +++ b/src/bin/mj2/CMakeLists.txt @@ -32,6 +32,10 @@ foreach(exe ${MJ2_SRCS} ${OPENJPEG_SOURCE_DIR}/src/bin/common/color.c ) + set_property( + TARGET ${exe} + APPEND PROPERTY COMPILE_DEFINITIONS USE_MJ2 + ) target_link_libraries(${exe} ${LCMS_LIBNAME} openmj2) if(UNIX)