Quellcode durchsuchen

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.
Lucas CHOLLET vor 1 Jahr
Ursprung
Commit
a9a5ca6754
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      Userland/Libraries/LibGfx/TIFFGenerator.py

+ 1 - 1
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 {}'