Skip to content

Instantly share code, notes, and snippets.

@hrehfeld hrehfeld/ Secret
Last active Mar 14, 2018

What would you like to do?
w_max = 2000
w_export = 507
export_ws = {}
# try all heights of crop rectangle
for w in range(w_export, w_max):
h = int(w * 2 / 3)
# now scale to export size with actual aspect ratio
h_export = int(w_export * h / w)
export_ws.setdefault(h_export, [])
for h in export_ws:
print('%s export height with these crop rectangle widths:\n %s...' % (h, export_ws[h][:10]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.