From a04eabd90d36c5dc6afc911c05888a607d070eb3 Mon Sep 17 00:00:00 2001 From: toqaalaa20 Date: Thu, 3 Jul 2025 14:37:51 +0300 Subject: [PATCH] adjust image width --- trdg/data_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trdg/data_generator.py b/trdg/data_generator.py index f96d554845..4258085ae6 100644 --- a/trdg/data_generator.py +++ b/trdg/data_generator.py @@ -136,7 +136,7 @@ def generate( resized_mask = distorted_mask.resize( (new_width, size - vertical_margin), Image.Resampling.NEAREST ) - background_width = width if width > 0 else new_width + horizontal_margin + background_width = max(width, new_width + horizontal_margin) background_height = size # Vertical text elif orientation == 1: