Commit c6c6cf69f5ebefa11a157e29a367a6be4cc5d36f

Authored by Austin Blanton
1 parent a8c8f400

ratio should be a float

Showing 1 changed file with 2 additions and 2 deletions
scripts/brpy/html_viz.py
... ... @@ -18,7 +18,7 @@ def crop_to_bb(x, y, width, height, imname, maxheight=None):
18 18 imwidth, imheight = img.size
19 19 if not maxheight:
20 20 maxheight = height
21   - ratio = maxheight / height
  21 + ratio = float(maxheight) / height
22 22 # note for future me:
23 23 # image is cropped with div width/height + overflow:hidden,
24 24 # resized with img height,
... ... @@ -37,7 +37,7 @@ def bbs_for_image(imname, bbs, maxheight=None, colors=None):
37 37 imwidth, imheight = img.size
38 38 if not maxheight:
39 39 maxheight = imheight
40   - ratio = maxheight/imheight
  40 + ratio = float(maxheight)/imheight
41 41 html = [
42 42 '<div style="position:relative">',
43 43 '<img src="%s" style="height:%ipx" />' % (imname, maxheight)
... ...