1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:07:34 +00:00

LibGfx/TIFF: Support tag names with capitalized acronym

We now turn 'ICCProfile' into 'icc_profile' instead of 'i_c_c_profile'.
This commit is contained in:
Lucas CHOLLET 2023-11-28 21:16:08 -05:00 committed by Andreas Kling
parent 62f28d9968
commit 5622e7d77c

View file

@ -144,7 +144,8 @@ def retrieve_biggest_type(types: List[TIFFType]) -> TIFFType:
def pascal_case_to_snake_case(name: str) -> str:
return re.sub(r'(?<!^)(?=[A-Z])', '_', name).lower()
name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', name).lower()
def generate_getter(tag: Tag) -> str: