Report errno string when writing files fails

Screenshot ignored errors, some render code printed 'Saved' without checking for failure.

note: errno is now cleared from IMB_saveiff so all callers don't need to.
This commit is contained in:
2016-01-11 12:32:29 +11:00
parent f28d3955e9
commit 961ac8eb85
7 changed files with 65 additions and 47 deletions

View File

@@ -48,6 +48,7 @@
#ifdef RNA_RUNTIME
#include <errno.h>
#include "BKE_image.h"
#include "BKE_packedFile.h"
#include "BKE_main.h"
@@ -101,7 +102,7 @@ static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports
write_ibuf->dither = scene->r.dither_intensity;
if (!BKE_imbuf_write(write_ibuf, path, &scene->r.im_format)) {
BKE_reportf(reports, RPT_ERROR, "Could not write image '%s'", path);
BKE_reportf(reports, RPT_ERROR, "Could not write image: %s, '%s'", strerror(errno), path);
}
if (write_ibuf != ibuf)