From 663b65df7fee9d9b68cdd96fec954a0b87fed96d Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Fri, 27 Dec 2024 09:44:19 -0500 Subject: [PATCH] minor xyz patch Signed-off-by: Vladimir Mandic --- scripts/xyz_grid_draw.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/xyz_grid_draw.py b/scripts/xyz_grid_draw.py index 23e98e0fe..29b083d5f 100644 --- a/scripts/xyz_grid_draw.py +++ b/scripts/xyz_grid_draw.py @@ -97,10 +97,10 @@ def draw_xyz_grid(p, xs, ys, zs, x_labels, y_labels, z_labels, cell, draw_legend process_cell(x, y, z, ix, iy, iz) if not processed_result: - shared.log.error("XYZ grid: Failed to initialize processing") + shared.log.error("XYZ grid: failed to initialize processing") return processing.Processed(p, []) elif not any(processed_result.images): - shared.log.error("XYZ grid: Failed to return processed image") + shared.log.error("XYZ grid: failed to return processed image") return processing.Processed(p, []) t1 = time.time() @@ -109,7 +109,10 @@ def draw_xyz_grid(p, xs, ys, zs, x_labels, y_labels, z_labels, cell, draw_legend idx0 = (i * len(xs) * len(ys)) + i # starting index of images in subgrid idx1 = (len(xs) * len(ys)) + idx0 # ending index of images in subgrid to_process = processed_result.images[idx0:idx1] - w, h = max(i.width for i in to_process), max(i.height for i in to_process) + w, h = max(i.width for i in to_process), max(i.height for i in to_process if i is not None) + if w is None or h is None or w == 0 or h == 0: + shared.log.error("XYZ grid: failed get valid image") + continue if (not no_grid or include_sub_grids) and images.check_grid_size(to_process): grid = images.image_grid(to_process, rows=len(ys)) if draw_legend: