aboutsummaryrefslogtreecommitdiff
path: root/modules/images.py
diff options
context:
space:
mode:
authorEllangoK <karun.ellango7@gmail.com>2023-01-24 02:24:32 -0500
committerEllangoK <karun.ellango7@gmail.com>2023-01-24 02:24:32 -0500
commite46bfa5a9e9b489ae925a9c23880e34fe8d9fffa (patch)
tree07f81c4debb13c60d8321faa9bf3341622bc979f /modules/images.py
parent9fc354e1303453bbd865cbede86da4c3273ed14f (diff)
handling sub grids and merging into one
Diffstat (limited to 'modules/images.py')
-rw-r--r--modules/images.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/images.py b/modules/images.py
index 3b1c5f34..0bc3d524 100644
--- a/modules/images.py
+++ b/modules/images.py
@@ -195,7 +195,7 @@ def draw_grid_annotations(im, width, height, hor_texts, ver_texts):
ver_text_heights = [sum([line.size[1] + line_spacing for line in lines]) - line_spacing * len(lines) for lines in
ver_texts]
- pad_top = max(hor_text_heights) + line_spacing * 2
+ pad_top = 0 if sum(hor_text_heights) == 0 else max(hor_text_heights) + line_spacing * 2
result = Image.new("RGB", (im.width + pad_left, im.height + pad_top), "white")
result.paste(im, (pad_left, pad_top))