diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2016-02-20 16:52:36 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-04-18 21:07:55 +0300 |
commit | 64bcdd65bf0727c5e39ac2b3f32bf897bfbf07a1 (patch) | |
tree | 1deb0d53867356cab6feecb0fa2f62c44ad88899 /source/blender/blenkernel/intern/image.c | |
parent | 690ed63eb55d1c52b051d8ce40e76e1b57291f29 (diff) |
Images: support packing edited images as OpenEXR or PNG.
This way float and multilayer images can now be packed without data loss. This
removes the as_png option and always uses the appropriate file format depending
on the image contents.
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 49d0440b207..e27f5734547 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -720,11 +720,10 @@ Image *BKE_image_add_from_imbuf(Main *bmain, ImBuf *ibuf, const char *name) return ima; } -/* Pack image buffer to memory as PNG. */ +/* Pack image buffer to memory as PNG or EXR. */ static bool image_memorypack_imbuf(Image *ima, ImBuf *ibuf, const char *filepath) { - ibuf->ftype = IMB_FTYPE_PNG; - ibuf->planes = R_IMF_PLANES_RGBA; + ibuf->ftype = (ibuf->rect_float) ? IMB_FTYPE_OPENEXR : IMB_FTYPE_PNG; IMB_saveiff(ibuf, filepath, IB_rect | IB_mem); |