diff options
author | Daniel Friesel <derf@finalrewind.org> | 2017-08-19 15:49:23 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2017-08-19 19:57:42 +0200 |
commit | be4c0b0120092f0d777704edb4ce34fac3cffb48 (patch) | |
tree | 0326ddf5531b8fc922c20eb6e0f3b4551535deed /src | |
parent | 9ffb418ac2a43ed0f76af84cb3269ab4d244e12b (diff) |
Make feh abort immediately if an index image could not be created (#306)
Diffstat (limited to 'src')
-rw-r--r-- | src/index.c | 3 | ||||
-rw-r--r-- | src/thumbnail.c | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/index.c b/src/index.c index 7a2f5fc..fbc25b8 100644 --- a/src/index.c +++ b/src/index.c @@ -149,7 +149,8 @@ void init_index_mode(void) im_main = imlib_create_image(index_image_width, index_image_height); if (!im_main) - eprintf("Imlib error creating index image, are you low on RAM?"); + eprintf("Failed to create %dx%d pixels (%d MB) index image. Do you have enough RAM?", + index_image_width, index_image_height, index_image_width * index_image_height * 4 / (1024*1024)); if (bg_im) gib_imlib_blend_image_onto_image(im_main, bg_im, diff --git a/src/thumbnail.c b/src/thumbnail.c index 08da0b2..edf0f4f 100644 --- a/src/thumbnail.c +++ b/src/thumbnail.c @@ -144,12 +144,14 @@ void init_thumbnail_mode(void) index_image_width = td.w; index_image_height = td.h + title_area_h; - D(("imlib_create_image(%d, %d)", index_image_width, index_image_height)); + D(("imlib_create_image(%d, %d)\n", index_image_width, index_image_height)); td.im_main = imlib_create_image(index_image_width, index_image_height); - gib_imlib_image_set_has_alpha(td.im_main, 1); if (!td.im_main) - eprintf("Imlib error creating index image, are you low on RAM?"); + eprintf("Failed to create %dx%d pixels (%d MB) index image. Do you have enough RAM?", + index_image_width, index_image_height, index_image_width * index_image_height * 4 / (1024*1024)); + + gib_imlib_image_set_has_alpha(td.im_main, 1); if (td.im_bg) gib_imlib_blend_image_onto_image(td.im_main, td.im_bg, |