uglygus / frameoverframe

Various tools for image sequence processing and organization. Useful for timelapse workflow.
MIT License
1 stars 0 forks source link

deflicker image file is truncated (not sure whether it is a local issue) #29

Closed charles1997 closed 3 years ago

charles1997 commented 3 years ago

charleslinux@charlesdesktop01:/mnt/c/Users/charles xu$ deflicker /mnt/l/summer2021/dst-enfused args== {'--format': 'png', '--outdir': 'INPATH/INFOLDERNAME_deflickered', '--quiet': False, '--sigma': None, '--window': 10, '': '/mnt/l/summer2021/dst-enfused'} 15:37:06 - INFO | This is deflicker 15:37:06 - INFO | Found 7 images in directory /mnt/l/summer2021/dst-enfused args== {'--format': 'png', '--outdir': '/mnt/l/summer2021/dst-enfused-deflickered', '--quiet': False, '--sigma': None, '--window': 10, '': '/mnt/l/summer2021/dst-enfused'} 15:37:06 - INFO | Calculating brightness of the images 92.33546080508475 91.73739337379632 91.5953303219273 90.97985916791032 90.58202364375688 90.31632041604485 Traceback (most recent call last): File "/home/charleslinux/.local/lib/python3.8/site-packages/PIL/ImageFile.py", line 237, in load s = read(self.decodermaxblock) File "/home/charleslinux/.local/lib/python3.8/site-packages/PIL/PngImagePlugin.py", line 896, in load_read cid, pos, length = self.png.read() File "/home/charleslinux/.local/lib/python3.8/site-packages/PIL/PngImagePlugin.py", line 162, in read length = i32(s) File "/home/charleslinux/.local/lib/python3.8/site-packages/PIL/_binary.py", line 75, in i32be return unpack_from(">I", c, o)[0] struct.error: unpack_from requires a buffer of at least 4 bytes for unpacking 4 bytes at offset 0 (actual buffer size is 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/charleslinux/.local/lib/python3.8/site-packages/imageio/plugins/pillow.py", line 669, in pil_try_read im.getdata()[0] File "/home/charleslinux/.local/lib/python3.8/site-packages/PIL/Image.py", line 1292, in getdata self.load() File "/home/charleslinux/.local/lib/python3.8/site-packages/PIL/ImageFile.py", line 243, in load raise OSError("image file is truncated") from e OSError: image file is truncated

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/charleslinux/.local/bin/deflicker", line 11, in load_entry_point('frameoverframe', 'console_scripts', 'deflicker')() File "/mnt/l/summer2021/frameoverframe/frameoverframe/cli/deflickermain.py", line 91, in main deflicker( File "/mnt/l/summer2021/frameoverframe/frameoverframe/deflicker.py", line 118, in deflicker brightness = calc_brightness(images, sigma=sigma) File "/mnt/l/summer2021/frameoverframe/frameoverframe/deflicker.py", line 68, in calc_brightness image = io.imread(filename) File "/home/charleslinux/.local/lib/python3.8/site-packages/skimage/io/_io.py", line 48, in imread img = call_plugin('imread', fname, plugin=plugin, plugin_args) File "/home/charleslinux/.local/lib/python3.8/site-packages/skimage/io/manage_plugins.py", line 207, in call_plugin return func(*args, *kwargs) File "/home/charleslinux/.local/lib/python3.8/site-packages/skimage/io/_plugins/imageio_plugin.py", line 10, in imread return np.asarray(imageio_imread(args, kwargs)) File "/home/charleslinux/.local/lib/python3.8/site-packages/imageio/core/functions.py", line 265, in imread reader = read(uri, format, "i", kwargs) File "/home/charleslinux/.local/lib/python3.8/site-packages/imageio/core/functions.py", line 186, in get_reader return format.get_reader(request) File "/home/charleslinux/.local/lib/python3.8/site-packages/imageio/core/format.py", line 170, in get_reader return self.Reader(self, request) File "/home/charleslinux/.local/lib/python3.8/site-packages/imageio/core/format.py", line 221, in init self._open(self.request.kwargs.copy()) File "/home/charleslinux/.local/lib/python3.8/site-packages/imageio/plugins/pillow.py", line 298, in _open return PillowFormat.Reader._open(self, pilmode=pilmode, as_gray=as_gray) File "/home/charleslinux/.local/lib/python3.8/site-packages/imageio/plugins/pillow.py", line 135, in _open pil_try_read(self._im) File "/home/charleslinux/.local/lib/python3.8/site-packages/imageio/plugins/pillow.py", line 680, in pil_try_read raise ValueError(error_message) ValueError: Could not load "" Reason: "image file is truncated" Please see documentation at: http://pillow.readthedocs.io/en/latest/installation.html#external-libraries

uglygus commented 3 years ago

fixed by 3acedd5bc425945f2ae17eb2c03a9012a98341b6

uglygus commented 3 years ago

If this worked. You should know which file is truncated you could use that file or group of files in other commands and they will crash too. Can you do that and create issues for the crashes. New error Output should look like this: ---TRUNCATED---> /Users/cooper/BIG STUFF/temp/testvid/Abina_short/Abina goodbye - Duke and Battersby 2021_00000004.png Could not load "" Reason: "image file is truncated" Please see documentation at: http://pillow.readthedocs.io/en/latest/installation.html#external-libraries