diff options
Diffstat (limited to 'source/blender/imbuf/intern/util.c')
-rw-r--r-- | source/blender/imbuf/intern/util.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index 32100aa2288..8b16e03aed2 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -186,11 +186,13 @@ int IMB_ispic_type(const char *name) #define HEADER_SIZE 64 unsigned char buf[HEADER_SIZE]; - ImFileType *type; + const ImFileType *type; BLI_stat_t st; int fp; - if (UTIL_DEBUG) printf("IMB_ispic_name: loading %s\n", name); + BLI_assert(!BLI_path_is_rel(name)); + + if (UTIL_DEBUG) printf("%s: loading %s\n", __func__, name); if (BLI_stat(name, &st) == -1) return false; @@ -389,7 +391,9 @@ int imb_get_anim_type(const char *name) int type; BLI_stat_t st; - if (UTIL_DEBUG) printf("in getanimtype: %s\n", name); + BLI_assert(!BLI_path_is_rel(name)); + + if (UTIL_DEBUG) printf("%s: %s\n", __func__, name); #ifndef _WIN32 # ifdef WITH_QUICKTIME @@ -434,8 +438,20 @@ int imb_get_anim_type(const char *name) bool IMB_isanim(const char *filename) { int type; - + type = imb_get_anim_type(filename); return (type && type != ANIM_SEQUENCE); } + +bool IMB_isfloat(ImBuf *ibuf) +{ + const ImFileType *type; + + for (type = IMB_FILE_TYPES; type < IMB_FILE_TYPES_LAST; type++) { + if (type->ftype(type, ibuf)) { + return (type->flag & IM_FTYPE_FLOAT) != 0; + } + } + return false; +} |