Skip to content

Commit

Permalink
Merge branch 'bugfix/resize' into release/v0.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpkane committed Sep 9, 2022
2 parents 30dd976 + 158ffeb commit d550dcf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion eta/core/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,12 @@ def resize(img, width=None, height=None, *args, **kwargs):
if width is None or width < 0:
width = int(round(iw * (height * 1.0 / ih)))

if (ih == 0) | (iw == 0) | (width == 0) | (height == 0):
shape = list(img.shape)
shape[:2] = (height, width)

return np.zeros(shape, dtype=img.dtype)

return cv2.resize(img, (width, height), *args, **kwargs)


Expand Down Expand Up @@ -1200,7 +1206,10 @@ class Convert(object):
"""Interface for the ImageMagick convert binary."""

def __init__(
self, executable="convert", in_opts=None, out_opts=None,
self,
executable="convert",
in_opts=None,
out_opts=None,
):
"""Constructs a convert command, minus the input/output paths.
Expand Down

0 comments on commit d550dcf

Please sign in to comment.