diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-20 17:19:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-20 17:19:21 +0300 |
commit | 8c6c6d01f4b0112a7ad0cc51fa37ed7de8592eac (patch) | |
tree | 0eac1de67a17bd5f0734eafa7e12a7291fccedf5 /source | |
parent | 6aea182b1e174a78443672596bc6dcd35cad413a (diff) |
WITH_OPENJPEG wasn't defined for CMake or SCons, which meant blender couldn't save jpeg2000 images from the file selector.
also fixed typo in jp2.c
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_image/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/editors/space_image/SConscript | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/jp2.c | 6 |
3 files changed, 10 insertions, 4 deletions
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)); |