mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-06-08 19:59:56 +02:00
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)
This commit is contained in:
parent
fbe2f2302f
commit
867a7261de
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@ def pil2cv(img):
|
||||||
|
|
||||||
def check_dpi(img):
|
def check_dpi(img):
|
||||||
try:
|
try:
|
||||||
if isinstance(img, Image.__class__):
|
if isinstance(img, Image.Image):
|
||||||
pil_image = img
|
pil_image = img
|
||||||
elif isinstance(img, str):
|
elif isinstance(img, str):
|
||||||
pil_image = Image.open(img)
|
pil_image = Image.open(img)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue