diff --git a/source/blender/editors/space_image/CMakeLists.txt b/source/blender/editors/space_image/CMakeLists.txt index c2166164b0a..ca3b1f58305 100644 --- a/source/blender/editors/space_image/CMakeLists.txt +++ b/source/blender/editors/space_image/CMakeLists.txt @@ -40,6 +40,10 @@ SET(SRC space_image.c ) +IF(WITH_IMAGE_OPENJPEG) + ADD_DEFINITIONS(-DWITH_OPENJPEG) +ENDIF(WITH_IMAGE_OPENJPEG) + IF(WITH_IMAGE_OPENEXR) ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_IMAGE_OPENEXR) diff --git a/source/blender/editors/space_image/SConscript b/source/blender/editors/space_image/SConscript index 15a7aeb828f..295e03caf32 100644 --- a/source/blender/editors/space_image/SConscript +++ b/source/blender/editors/space_image/SConscript @@ -14,11 +14,13 @@ if env['WITH_BF_LCMS']: incs += ' ' + env['BF_LCMS_INC'] if env['WITH_BF_OPENEXR']: defs.append('WITH_OPENEXR') +if env['WITH_BF_OPENJPEG']: + defs.append('WITH_OPENJPEG') if env['WITH_BF_TIFF']: defs.append('WITH_TIFF') if env['WITH_BF_CINEON']: defs.append('WITH_CINEON') - + if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c index 3f0443e5a88..49920219d8c 100644 --- a/source/blender/imbuf/intern/jp2.c +++ b/source/blender/imbuf/intern/jp2.c @@ -55,14 +55,14 @@ typedef struct img_folder{ float *rates; }img_fol_t; -static int checkj2p(unsigned char *mem) /* J2K_CFMT */ +static int check_jp2(unsigned char *mem) /* J2K_CFMT */ { return memcmp(JP2_HEAD, mem, 12) ? 0 : 1; } int imb_is_a_jp2(unsigned char *buf) { - return checkj2p(buf); + return check_jp2(buf); } @@ -112,7 +112,7 @@ struct ImBuf *imb_jp2_decode(unsigned char *mem, size_t size, int flags) opj_dinfo_t* dinfo = NULL; /* handle to a decompressor */ opj_cio_t *cio = NULL; - if (checkj2p(mem) == 0) return(0); + if (check_jp2(mem) == 0) return(0); /* configure the event callbacks (not required) */ memset(&event_mgr, 0, sizeof(opj_event_mgr_t));