amietn / vcsi

Create video contact sheets, thumbnails
MIT License
491 stars 57 forks source link

PIL.UnidentifiedImageError: cannot identify image file #104

Open S-hdyn opened 2 years ago

S-hdyn commented 2 years ago

I got this error while vcsi running:

  File "C:\Users\Users\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Users\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Users\AppData\Local\Programs\Python\Python38\Scripts\vcsi.exe\__main__.py", line 7, in <module>
  File "C:\Users\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\vcsi\__init__.py", line 3, in main
    vcsi.vcsi.main()
  File "C:\Users\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\vcsi\vcsi.py", line 1636, in main
    process_file_or_ignore(filename, args)
  File "C:\Users\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\vcsi\vcsi.py", line 1610, in process_file_or_ignore
    process_file(filepath, args)
  File "C:\Users\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\vcsi\vcsi.py", line 1764, in process_file
    selected_frames, temp_frames = select_sharpest_images(media_info, media_capture, args)
  File "C:\Users\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\vcsi\vcsi.py", line 740, in select_sharpest_images
    frame = do_capture(timestamp_tuple, desired_size[0], desired_size[1], suffix, args)
  File "C:\Users\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\vcsi\vcsi.py", line 700, in do_capture
    blurriness = media_capture.compute_blurriness(filename)
  File "C:\Users\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\vcsi\vcsi.py", line 596, in compute_blurriness
    i = Image.open(image_path)
  File "C:\Users\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\Image.py", line 3147, in open
    raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file 'C:\\Users\\Users\\AppData\\Local\\Temp\\tmp9mgmvoj4.bmp'

I'm even checking in vcsi.py in line 31: from PIL import Image, etc. Reading from this article, it's already same. vcsi.py uses from PIL import modules instead of import modules only. Checking the image file 'C:\Users\Users\AppData\Local\Temp\tmp9mgmvoj4.bmp' and it turns out 0KB tmp file, tried re-generating thumbnail but not working. Always one image file that has 0KB size and turns out it's empty, no metadata image at all.

Is there's any solution for this? Thanks in advance

S-hdyn commented 2 years ago

Screenshot at 20220721231554

In case anyone needs proof of 0KB file.

Qwerty-Space commented 1 year ago

I'm also experiencing this issue

image

redthing1 commented 1 year ago

Me too.

xanadu6291 commented 11 months ago

I had the same issue. In my case, by setting --end-delay-percent option to 20 fixed the issue...

AnLuoRidge commented 9 months ago

Same issue as in https://github.com/amietn/vcsi/issues/86