diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-11-05 14:32:47 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-11-05 14:32:47 +0400 |
commit | 316d33ea0b9d9d5a28f689a30879a28b599a7e0c (patch) | |
tree | d0352a6ffbba56a18a559740d44eed40b4786c98 /source/blender/imbuf | |
parent | 71b8469e3b48d179c18b36d1c45c56a5d14e1180 (diff) |
Change a way how image sequence/movie source is detecting for movie clip
Use IMB_testiffname to check whether file could be handled by ImBuf or
whether it should be handled by anim routines.
It solves the issue when file without extension is used for movie clip.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/IMB_imbuf.h | 2 | ||||
-rw-r--r-- | source/blender/imbuf/intern/png.c | 3 | ||||
-rw-r--r-- | source/blender/imbuf/intern/readimage.c | 6 |
3 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index e297ebe3980..d0ac71a7131 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -103,7 +103,7 @@ struct ImBuf *IMB_ibImageFromMemory(unsigned char *mem, size_t size, int flags, * * \attention Defined in readimage.c */ -struct ImBuf *IMB_testiffname(const char *filepath, int flags, char colorspace[IM_MAX_SPACE]); +struct ImBuf *IMB_testiffname(const char *filepath, int flags); /** * diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c index 6310d8e105f..dcfebb95b87 100644 --- a/source/blender/imbuf/intern/png.c +++ b/source/blender/imbuf/intern/png.c @@ -558,7 +558,8 @@ ImBuf *imb_loadpng(unsigned char *mem, size_t size, int flags, char colorspace[I MEM_freeN(pixels); if (pixels16) MEM_freeN(pixels16); - MEM_freeN(row_pointers); + if (row_pointers) + MEM_freeN(row_pointers); png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); return(ibuf); diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c index a1fa05d1098..5669a4cc45d 100644 --- a/source/blender/imbuf/intern/readimage.c +++ b/source/blender/imbuf/intern/readimage.c @@ -100,7 +100,8 @@ ImBuf *IMB_ibImageFromMemory(unsigned char *mem, size_t size, int flags, char co } } - fprintf(stderr, "%s: unknown fileformat (%s)\n", __func__, descr); + if ((flags & IB_test) == 0) + fprintf(stderr, "%s: unknown fileformat (%s)\n", __func__, descr); return NULL; } @@ -170,11 +171,12 @@ ImBuf *IMB_loadiffname(const char *filepath, int flags, char colorspace[IM_MAX_S return ibuf; } -ImBuf *IMB_testiffname(const char *filepath, int flags, char colorspace[IM_MAX_SPACE]) +ImBuf *IMB_testiffname(const char *filepath, int flags) { ImBuf *ibuf; int file; char filepath_tx[IB_FILENAME_SIZE]; + char colorspace[IM_MAX_SPACE]; imb_cache_filename(filepath_tx, filepath, flags); |