From 1e551dfd9d66998e4337a2b26dba07bd5b419e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Sat, 30 Nov 2024 10:04:26 +0100 Subject: [PATCH] Fix for legend image with no images --- tilecloud_chain/controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tilecloud_chain/controller.py b/tilecloud_chain/controller.py index b0d5a0737..1be201f23 100644 --- a/tilecloud_chain/controller.py +++ b/tilecloud_chain/controller.py @@ -410,8 +410,8 @@ def _generate_legend_images(gene: TileGeneration) -> None: response.content, exc_info=True, ) - width = max(i.size[0] for i in legends) if legends else 0 - height = sum(i.size[1] for i in legends) if legends else 0 + width = max(1, max(i.size[0] for i in legends) if legends else 0) + height = max(1, sum(i.size[1] for i in legends) if legends else 0) image = Image.new("RGBA", (width, height)) y = 0 for i in legends: