diff options
Diffstat (limited to 'source/blender/imbuf/intern/writeimage.c')
-rw-r--r-- | source/blender/imbuf/intern/writeimage.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c index d6f2f801725..e93df7b73ba 100644 --- a/source/blender/imbuf/intern/writeimage.c +++ b/source/blender/imbuf/intern/writeimage.c @@ -22,7 +22,6 @@ * \ingroup imbuf */ - #include <stdio.h> #include <stdlib.h> #include <errno.h> @@ -39,53 +38,54 @@ static bool prepare_write_imbuf(const ImFileType *type, ImBuf *ibuf) { - return IMB_prepare_write_ImBuf((type->flag & IM_FTYPE_FLOAT), ibuf); + return IMB_prepare_write_ImBuf((type->flag & IM_FTYPE_FLOAT), ibuf); } short IMB_saveiff(struct ImBuf *ibuf, const char *name, int flags) { - const ImFileType *type; + const ImFileType *type; - errno = 0; + errno = 0; - BLI_assert(!BLI_path_is_rel(name)); + BLI_assert(!BLI_path_is_rel(name)); - if (ibuf == NULL) return (false); - ibuf->flags = flags; + if (ibuf == NULL) + return (false); + ibuf->flags = flags; - for (type = IMB_FILE_TYPES; type < IMB_FILE_TYPES_LAST; type++) { - if (type->save && type->ftype(type, ibuf)) { - short result = false; + for (type = IMB_FILE_TYPES; type < IMB_FILE_TYPES_LAST; type++) { + if (type->save && type->ftype(type, ibuf)) { + short result = false; - prepare_write_imbuf(type, ibuf); + prepare_write_imbuf(type, ibuf); - result = type->save(ibuf, name, flags); + result = type->save(ibuf, name, flags); - return result; - } - } + return result; + } + } - fprintf(stderr, "Couldn't save picture.\n"); + fprintf(stderr, "Couldn't save picture.\n"); - return false; + return false; } bool IMB_prepare_write_ImBuf(const bool isfloat, ImBuf *ibuf) { - bool changed = false; - - if (isfloat) { - /* pass */ - } - else { - if (ibuf->rect == NULL && ibuf->rect_float) { - ibuf->rect_colorspace = colormanage_colorspace_get_roled(COLOR_ROLE_DEFAULT_BYTE); - IMB_rect_from_float(ibuf); - if (ibuf->rect != NULL) { - changed = true; - } - } - } - - return changed; + bool changed = false; + + if (isfloat) { + /* pass */ + } + else { + if (ibuf->rect == NULL && ibuf->rect_float) { + ibuf->rect_colorspace = colormanage_colorspace_get_roled(COLOR_ROLE_DEFAULT_BYTE); + IMB_rect_from_float(ibuf); + if (ibuf->rect != NULL) { + changed = true; + } + } + } + + return changed; } |