[Bf-blender-cvs] [981245fc6fc] blender-v3.3-release: Fix T102421: Image.save() not respecting set image.file_format

Brecht Van Lommel noreply at git.blender.org
Mon Nov 28 14:55:10 CET 2022


Commit: 981245fc6fc29538e625edf429f926f7a182ddb7
Author: Brecht Van Lommel
Date:   Mon Nov 14 17:09:13 2022 +0100
Branches: blender-v3.3-release
https://developer.blender.org/rB981245fc6fc29538e625edf429f926f7a182ddb7

Fix T102421: Image.save() not respecting set image.file_format

The default file type for new ImBuf is already PNG, no need to override it
again in the save method.

===================================================================

M	source/blender/blenkernel/intern/image_save.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/image_save.cc b/source/blender/blenkernel/intern/image_save.cc
index ce77564ecaf..aae9576121a 100644
--- a/source/blender/blenkernel/intern/image_save.cc
+++ b/source/blender/blenkernel/intern/image_save.cc
@@ -117,16 +117,10 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts,
       }
     }
     else {
-      if (ima->source == IMA_SRC_GENERATED) {
-        opts->im_format.imtype = R_IMF_IMTYPE_PNG;
-        opts->im_format.compress = ibuf->foptions.quality;
-        opts->im_format.planes = ibuf->planes;
-        if (!IMB_colormanagement_space_name_is_data(ima_colorspace)) {
-          ima_colorspace = IMB_colormanagement_role_colorspace_name_get(COLOR_ROLE_DEFAULT_BYTE);
-        }
-      }
-      else {
-        BKE_image_format_from_imbuf(&opts->im_format, ibuf);
+      BKE_image_format_from_imbuf(&opts->im_format, ibuf);
+      if (ima->source == IMA_SRC_GENERATED &&
+          !IMB_colormanagement_space_name_is_data(ima_colorspace)) {
+        ima_colorspace = IMB_colormanagement_role_colorspace_name_get(COLOR_ROLE_DEFAULT_BYTE);
       }
 
       /* use the multiview image settings as the default */



More information about the Bf-blender-cvs mailing list