[Bf-blender-cvs] [5f4afecbf35] blender-v3.4-release: Fix T102421: Image.save() not respecting set image.file_format

Brecht Van Lommel noreply at git.blender.org
Mon Nov 14 17:16:04 CET 2022


Commit: 5f4afecbf3559a7ddcc2621d1e863a5425859404
Author: Brecht Van Lommel
Date:   Mon Nov 14 17:09:13 2022 +0100
Branches: blender-v3.4-release
https://developer.blender.org/rB5f4afecbf3559a7ddcc2621d1e863a5425859404

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 003211e6288..99fc6ff5923 100644
--- a/source/blender/blenkernel/intern/image_save.cc
+++ b/source/blender/blenkernel/intern/image_save.cc
@@ -119,16 +119,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