Skip to content

Commit

Permalink
Use instead of when reading in file from PIL
Browse files Browse the repository at this point in the history
  • Loading branch information
leblancfg committed Aug 3, 2022
1 parent 6ac79a7 commit 6826805
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autocrop/autocrop.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def check_positive_scalar(num):
def open_file(input_filename):
"""Given a filename, returns a numpy array"""
with Image.open(input_filename) as img_orig:
return np.asarray(img_orig)
return np.array(img_orig)


class Cropper:
Expand Down Expand Up @@ -207,7 +207,7 @@ def crop(self, path_or_array):
# Resize
if self.resize:
with Image.fromarray(image) as img:
image = np.asarray(img.resize((self.width, self.height)))
image = np.array(img.resize((self.width, self.height)))

# Underexposition fix
if self.gamma:
Expand Down

0 comments on commit 6826805

Please sign in to comment.