Skip to content

Commit dae8917

Browse files
committed
Fix ratio computation.
1 parent 08a8e10 commit dae8917

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/measure/prep_display_image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ def display(
127127
# rescale according to non-negative value
128128
if image_res[0] < 0:
129129
new_height = image_res[1]
130-
ratio = new_height / float(image_width)
130+
ratio = new_height / float(image_height)
131131
image_res = (int(ratio * image_width), new_height)
132132

133133
elif image_res[1] < 0:
134134
new_width = image_res[0]
135-
ratio = new_width / float(image_height)
135+
ratio = new_width / float(image_width)
136136
image_res = (new_width, int(ratio * image_height))
137137

138138
# set image within screen

0 commit comments

Comments
 (0)