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:
authorCampbell Barton <ideasman42@gmail.com>2016-01-14 10:51:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-01-14 10:56:23 +0300
commit351d6d18aae431372933e6a024413a63ad976009 (patch)
tree52f788953361cb12ab328e80b783b7b68269e23d /source/blender/blenkernel/intern/image.c
parent15b97e799f66706a642104a9130bfc412fa01063 (diff)
Fix image save ignoring options
Saving an image didn't un-set previously enabled options. (saving 16bit png as 8 bit didn't work for eg).
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r--source/blender/blenkernel/intern/image.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 7eea53497b2..55cbf13ed34 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -2174,6 +2174,9 @@ void BKE_imbuf_write_prepare(ImBuf *ibuf, const ImageFormatData *imf)
char compress = imf->compress;
char quality = imf->quality;
+ /* initialize all from image format */
+ ibuf->foptions.flag = 0;
+
if (imtype == R_IMF_IMTYPE_IRIS) {
ibuf->ftype = IMB_FTYPE_IMAGIC;
}
@@ -2214,7 +2217,6 @@ void BKE_imbuf_write_prepare(ImBuf *ibuf, const ImageFormatData *imf)
ibuf->ftype = IMB_FTYPE_OPENEXR;
if (imf->depth == R_IMF_CHAN_DEPTH_16)
ibuf->foptions.flag |= OPENEXR_HALF;
- ibuf->foptions.flag &= ~OPENEXR_COMPRESS;
ibuf->foptions.flag |= (imf->exr_codec & OPENEXR_COMPRESS);
if (!(imf->flag & R_IMF_FLAG_ZBUF))
@@ -2334,6 +2336,7 @@ int BKE_imbuf_write_as(ImBuf *ibuf, const char *name, ImageFormatData *imf,
/* note that we are not restoring _all_ settings */
ibuf->planes = ibuf_back.planes;
ibuf->ftype = ibuf_back.ftype;
+ ibuf->foptions = ibuf_back.foptions;
}
return ok;