From d14836c10973bb31d34630f571c2f4195a39ffa4 Mon Sep 17 00:00:00 2001 From: klemek Date: Sun, 8 Nov 2026 13:12:23 +0100 Subject: [PATCH] fix: add error if no image provided upong starting --- src/glsl_glyphs/reader.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/glsl_glyphs/reader.py b/src/glsl_glyphs/reader.py index c578d2c..838be36 100644 --- a/src/glsl_glyphs/reader.py +++ b/src/glsl_glyphs/reader.py @@ -18,7 +18,9 @@ MAX_GLYPHS = 256 class Reader: def __init__(self, params: Parameters) -> None: - self.source_image_path = pathlib.Path(params.source_image_path) + self.source_image_path = ( + pathlib.Path(params.source_image_path) if params.source_image_path else None + ) self.source_names_path = ( pathlib.Path(params.source_names_path) if params.source_names_path else None ) @@ -60,6 +62,11 @@ class Reader: return self.__read_sentences(names) def __read_image(self) -> list[Glyph]: + if not self.source_image_path: + self.log.error( + "No input image provided" + ) + sys.exit(1) try: img = Image.open(self.source_image_path).convert("1") if img.width % 8 != 0 or img.height % 8 != 0: