Commit 4c3b8ef
Changed files (1)
src
ai
images
src/ai/images/utils.py
@@ -45,12 +45,11 @@ def extract_aspect_ratio(text: str) -> tuple[str, str]:
if match := re.search(pattern, text):
return match.group(2), text
- text = text.lower()
- if "portrait" in text:
+ if "portrait" in text.lower():
return "9:16", text
- if "landscape" in text:
+ if "landscape" in text.lower():
return "16:9", text
- if "square" in text:
+ if "square" in text.lower():
return "1:1", text
return "", text # default