Spaces:
Runtime error
Runtime error
Update app.py
Browse files110 unmodified lines111112113114115116110 unmodified linestarget_height=1280overlap=48fade_width=24# Calculate the required height for 9:16 ratiotarget_height = (source.width * target_ratio[1]) // target_ratio[0]110 unmodified lines111112113114115116117118119120121122123124110 unmodified linestarget_height=1280overlap=48fade_width=24max_width = 720# Resize the image if it's wider than max_widthif source.width > max_width:scale_factor = max_width / source.widthnew_width = max_widthnew_height = int(source.height * scale_factor)source = source.resize((new_width, new_height), Image.LANCZOS)# Calculate the required height for 9:16 ratiotarget_height = (source.width * target_ratio[1]) // target_ratio[0]
app.py+8