Skip to content

Commit

Permalink
ensure coordinates are int and also ensure radius is int and not float
Browse files Browse the repository at this point in the history
  • Loading branch information
jessezach committed Aug 21, 2019
1 parent dd1ee95 commit 6df9ad9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RobotEyes/selenium_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def blur_regions(self, selectors, radius, path):
left, right, top, bottom = self._update_coordinates(left, right, top, bottom)
im = Image.open(path + '/img' + str(self.count) + '.png')
cropped_image = im.crop((left, top, right, bottom))
blurred_image = cropped_image.filter(ImageFilter.GaussianBlur(radius=float(radius)))
blurred_image = cropped_image.filter(ImageFilter.GaussianBlur(radius=int(radius)))
im.paste(blurred_image, (left, top, right, bottom))
im.save(path + '/img' + str(self.count) + '.png')

Expand Down Expand Up @@ -121,4 +121,4 @@ def _update_coordinates(self, left, right, top, bottom):
right = right * 2
top = top * 2
bottom = bottom * 2
return left, right, top, bottom
return int(left), int(right), int(top), int(bottom)

0 comments on commit 6df9ad9

Please sign in to comment.