Commit 4c3b8ef

benny-dou <60535774+benny-dou@users.noreply.github.com>
2026-02-27 03:08:44
fix(ai): case-insensitive aspect ratio detection
1 parent b172bf1
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