Adds type conversion for the radius value in _blur_regions function #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Environment:
OS: Windows 10
Browser: Chrome
Version: 70.0.3538.102 (Official Build) (64-bit)
Robot Framework: 3.0.4
Python: 3.7.0
Issue:
This is how I'm declaring the
radius
scalar variable in my Robot Framework test case:However, I was seeing the following error when using the
radius
argument in thecapture full screen
keyword:TypeError: must be real number, not str
I narrowed down the issue to the init.py file, line 298, in the _blur_regions function:
blurred_image = cropped_image.filter(ImageFilter.GaussianBlur(radius=radius))
The code is expecting a float, but is interpreting (for some reason) that the argument is a string. (perhaps a Robot Framework limitation?)
Fix:
I implemented type convertion from string to float to that argument:
blurred_image = cropped_image.filter(ImageFilter.GaussianBlur(radius=float(radius)))
Testing:
test
mode and play around with theradius
value.Expected result:
Additional changes: