From 4767229a7c4c9a2ea6ee19b80941c24d9bba03ce Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Fri, 10 Aug 2018 22:13:30 +0200 Subject: [PATCH] Close file after writing raw image. * Fixes #365 --- src/omv/img/imlib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/omv/img/imlib.c b/src/omv/img/imlib.c index 1a9307a41..9ffa02944 100644 --- a/src/omv/img/imlib.c +++ b/src/omv/img/imlib.c @@ -632,6 +632,7 @@ void imlib_save_image(image_t *img, const char *path, rectangle_t *roi, int qual FIL fp; file_write_open(&fp, path); write_data(&fp, img->pixels, img->w * img->h); + file_close(&fp); break; } case FORMAT_JPG: @@ -648,6 +649,7 @@ void imlib_save_image(image_t *img, const char *path, rectangle_t *roi, int qual char *new_path = strcat(strcpy(fb_alloc(strlen(path)+5), path), ".raw"); file_write_open(&fp, new_path); write_data(&fp, img->pixels, img->w * img->h); + file_close(&fp); fb_free(); } else { // RGB or GS, save as BMP. char *new_path = strcat(strcpy(fb_alloc(strlen(path)+5), path), ".bmp");