summaryrefslogtreecommitdiff
path: root/src/index.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-07-20 05:44:57 +0200
committerDaniel Friesel <derf@finalrewind.org>2018-07-20 05:44:57 +0200
commit9f65dacdcf4e01ddf7becea9fc57072bdbd5c175 (patch)
treed5bbd6b59410e52174fa8269e53d7f0e8fdca362 /src/index.c
parent9372e9302a429478d95ddd4036ffe55059c4f032 (diff)
Blame Imlib2 when failing to create > 32000x32000 px image
Diffstat (limited to 'src/index.c')
-rw-r--r--src/index.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/index.c b/src/index.c
index ca1664b..af3adea 100644
--- a/src/index.c
+++ b/src/index.c
@@ -147,9 +147,16 @@ void init_index_mode(void)
index_image_height = h + title_area_h;
im_main = imlib_create_image(index_image_width, index_image_height);
- if (!im_main)
- 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 (!im_main) {
+ if (index_image_height >= 32768 || index_image_width >= 32768) {
+ eprintf("Failed to create %dx%d pixels (%d MB) index image.\n"
+ "This is probably due to Imlib2 issues when dealing with images larger than 32k x 32k pixels.",
+ index_image_width, index_image_height, index_image_width * index_image_height * 4 / (1024*1024));
+ } else {
+ 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,