From a9a5ca6754f8b1d473df49b07186322e1e6e924a Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Sun, 14 Jan 2024 23:01:46 -0500 Subject: [PATCH] LibGfx/TIFF: Expose default value for numerical tags too Due to the integer -> bool conversion rule, the condition was wrong. We actually want to test for a not `None` state. --- Userland/Libraries/LibGfx/TIFFGenerator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/TIFFGenerator.py b/Userland/Libraries/LibGfx/TIFFGenerator.py index a7f7867218..fdfdff7b3f 100755 --- a/Userland/Libraries/LibGfx/TIFFGenerator.py +++ b/Userland/Libraries/LibGfx/TIFFGenerator.py @@ -313,7 +313,7 @@ def generate_getter(tag: Tag) -> str: signature = fR" Optional<{return_type}> {pascal_case_to_snake_case(tag.name)}() const" - if tag.default and single_count: + if tag.default is not None and single_count: return_if_empty = f'{default_value_to_cpp(tag.default)}' else: return_if_empty = 'OptionalNone {}'