Answers for "cannot identify image file <_io.BytesIO object a> site:stackoverflow.com"

1

cannot identify image file <_io.BytesIO object a> site:stackoverflow.com

import PIL
from pathlib import Path
from PIL import UnidentifiedImageError

path = Path("INSERT PATH HERE").rglob("*.jpeg")
for img_p in path:
    try:
        img = PIL.Image.open(img_p)
    except PIL.UnidentifiedImageError:
            print(img_p)
Posted by: Guest on September-19-2021

Code answers related to "cannot identify image file <_io.BytesIO object a> site:stackoverflow.com"

Browse Popular Code Answers by Language