pil_cv2.check_dpi: fix class membership test

(depending on how the `PIL.Image` was instantiated – file plugin or array interface – the previous `isinstance` could fail, provoking a fall-through to `cv2pil` which does not work)
pull/109/head
Robert Sachunsky 2 years ago committed by GitHub
parent fbe2f2302f
commit 867a7261de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,7 +16,7 @@ def pil2cv(img):
def check_dpi(img):
try:
if isinstance(img, Image.__class__):
if isinstance(img, Image.Image):
pil_image = img
elif isinstance(img, str):
pil_image = Image.open(img)

Loading…
Cancel
Save