Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/imbuf/intern/writeimage.c')
-rw-r--r--source/blender/imbuf/intern/writeimage.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c
index 71ecc8b14ae..f21d274f8fd 100644
--- a/source/blender/imbuf/intern/writeimage.c
+++ b/source/blender/imbuf/intern/writeimage.c
@@ -43,8 +43,6 @@ static bool prepare_write_imbuf(const ImFileType *type, ImBuf *ibuf)
bool IMB_saveiff(struct ImBuf *ibuf, const char *filepath, int flags)
{
- const ImFileType *type;
-
errno = 0;
BLI_assert(!BLI_path_is_rel(filepath));
@@ -54,8 +52,9 @@ bool IMB_saveiff(struct ImBuf *ibuf, const char *filepath, int flags)
}
ibuf->flags = flags;
- for (type = IMB_FILE_TYPES; type < IMB_FILE_TYPES_LAST; type++) {
- if (type->save && type->ftype(type, ibuf)) {
+ const ImFileType *type = IMB_file_type_from_ibuf(ibuf);
+ if (type != NULL) {
+ if (type->save != NULL) {
prepare_write_imbuf(type, ibuf);
return type->save(ibuf, filepath, flags);
}