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.
This commit is contained in:
Brecht Van Lommel 2022-11-14 17:09:13 +01:00
parent 99d00a7489
commit 5f4afecbf3
Notes: blender-bot 2023-02-13 14:03:05 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3
Referenced by issue #102421, Image.save() more heavy than original when using bpy
1 changed files with 4 additions and 10 deletions

View File

@ -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 */