feat(product-suite): add direct job state machine
This commit is contained in:
@@ -2776,7 +2776,19 @@ def _save_jpeg(image_bytes, out_path, resolution, jpg_quality):
|
||||
|
||||
|
||||
def _resolution_size(resolution):
|
||||
return _RESOLUTION_SIZES.get(str(resolution))
|
||||
text = str(resolution or "").strip().lower()
|
||||
mapped = _RESOLUTION_SIZES.get(text)
|
||||
if mapped:
|
||||
return mapped
|
||||
if "x" in text:
|
||||
width, height = text.split("x", 1)
|
||||
try:
|
||||
width, height = int(width), int(height)
|
||||
except (TypeError, ValueError):
|
||||
return None
|
||||
if width > 0 and height > 0:
|
||||
return width, height
|
||||
return None
|
||||
|
||||
|
||||
def _resolution_size_text(resolution):
|
||||
|
||||
Reference in New Issue
Block a user