bugfix [#24287] Saving the render result through the API does not use the scene settings

use scene alpha and dither settings.
This commit is contained in:
2010-10-27 22:13:05 +00:00
parent 58a1ddcc9e
commit cbb47c1dac

View File

@@ -73,9 +73,17 @@ static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports
if (ibuf == NULL) {
BKE_reportf(reports, RPT_ERROR, "Couldn't acquire buffer from image");
}
if (!BKE_write_ibuf(NULL, ibuf, path, scene->r.imtype, scene->r.subimtype, scene->r.quality)) {
BKE_reportf(reports, RPT_ERROR, "Couldn't write image: %s", path);
else {
/* temp swap out the color */
const unsigned char imb_depth_back= ibuf->depth;
const float dither_back= ibuf->dither;
ibuf->depth= scene->r.planes;
ibuf->dither= scene->r.dither_intensity;
if (!BKE_write_ibuf(NULL, ibuf, path, scene->r.imtype, scene->r.subimtype, scene->r.quality)) {
BKE_reportf(reports, RPT_ERROR, "Couldn't write image: %s", path);
}
ibuf->depth= imb_depth_back;
ibuf->dither= dither_back;
}
BKE_image_release_ibuf(image, lock);