Skip to content

Instantly share code, notes, and snippets.

@hrehfeld hrehfeld/test2.py Secret
Last active Mar 14, 2018

Embed
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, [])
export_ws[h_export].append(w)
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.