summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2021-12-30 06:55:32 +0100
committerKim Woelders <kim@woelders.dk>2021-12-30 06:56:35 +0100
commit86e3b4fadad40cf28075ef0c7116adbb2b99b26e (patch)
treeb09c583aafaa5d21abad41bfbfc7930190c94774
parent503e8527c3db11355ca10544601626cbf9cb6a4a (diff)
downloadimlib2-86e3b4fadad40cf28075ef0c7116adbb2b99b26e.tar.gz
imlib2_grab: Print error message if saving fails
-rw-r--r--src/bin/imlib2_grab.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bin/imlib2_grab.c b/src/bin/imlib2_grab.c
index c567e17..e7db343 100644
--- a/src/bin/imlib2_grab.c
+++ b/src/bin/imlib2_grab.c
@@ -32,6 +32,7 @@ main(int argc, char **argv)
unsigned int wo, ho;
unsigned int depth;
Window rr;
+ Imlib_Load_Error err;
verbose = 0;
get_alpha = 1;
@@ -132,7 +133,9 @@ main(int argc, char **argv)
}
imlib_context_set_image(im);
- imlib_save_image(file);
+ imlib_save_image_with_error_return(file, &err);
+ if (err != IMLIB_LOAD_ERROR_NONE)
+ fprintf(stderr, "Failed to save image to '%s' (error %d)\n", file, err);
return 0;
}