Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help request: No files to parse or invalid data #112

Open
tomatenforever opened this issue Jan 30, 2019 · 12 comments
Open

Help request: No files to parse or invalid data #112

tomatenforever opened this issue Jan 30, 2019 · 12 comments

Comments

@tomatenforever
Copy link

Hello,

while parsing my chaotic image library, i sometimes get the message: 'No files to parse or invalid data'. I get the point that some image files may be corrupt, but it would be nice if the script would just skip them instead of stopping completely.
I have over 100k images and i never made it to the point where the script is actually moving the files into folder...
Is there already an option to skip those corrupt files or do i need to make a feature request?

Regards

@michaellin925
Copy link

I have the same issue that it kept showing 'No files to parse or invalid data'. I tried to change the path of src_dir and dest_dir, then it worked!

Try 'python sortphotos.py dest_dir dest_dir'.

@andrewning
Copy link
Owner

The error comes about if exiftool (a 3rd party dependency) has a failure. I don't have much control over that, but if I had some example files that caused problems maybe I could figure something out.

@IT-Cru
Copy link

IT-Cru commented Oct 29, 2019

@andrewning: Perhaps I can provide you with some not working testing files (images and movies) which are maybe corrupted after recovery from 'photorec' tool from an overridden HDD. I have to check first with my customer that it is ok for him to send you some of these files.

@dennorske
Copy link

Did anyone figure out how to get around this?

@dennorske
Copy link

I just found out what my problem was. I had downloaded all my pictures (300+ gb) from google photos, and i tried to sort them after my preference.
While doing this, I had albums with emoji names from google photo (invalid names basically) and the error appeared. Renaming my folders and paths to valid filenames and folder names, the script ran flawlessly. So maybe, check on which directory and files it fails on, and see if it can have something to do with this

@AMacleod79
Copy link

Hi, having the same error and wondering if this is to do with files in the cloud which are not downloaded onto my laptop so they are not seen. (I have tried downloading a few of them and then the script runs). Any ideas on how to solve this (I really don't want to download over 150 gb of photos)?

@dennorske
Copy link

What are you trying to solve?

@andrewning
Copy link
Owner

@AMacleod79 this script can only organize local files. It cannot organize files in the cloud.

@nicbehr
Copy link

nicbehr commented May 29, 2020

I had the same problem, in the end it was due to an ä in the name of the folder following the evaluated file. Renaming solved it. Poor umlaut-users of the world...

@ghost
Copy link

ghost commented Jan 8, 2021

root cause seems to be incorrect (?) escaping of path- and filenames in exiftools as surmised by @andrewning.

workaround: ensure paths included no characters that needed escaping (also would apply to @nicbehr's issue).

The issue occured to me for various JPGs, but the files itself were unconspicious. I first assumed that the binary EXIF comments might be the cause or other vendor-specific code in the EXIF timestamps (exiv2 helped with debugging), as suggested by parts of the error mesage.

However, they were located in a nested folder with spaces ((.*)\ (.*)\ (.*)\\/(.*)~ish). Renaming the containing folder fixed the issue, seems the exiftool perl code may hiccup there. @andrewning - if you are interested in debugging, here's a path that caused it (s/[a-z]/a/, s/\d/0/ was applied).

Besides - sortphotos.py saved me days of work, so thanks a lot :-)

/aaa/aaaaa/aaaa/aaa\ aaaaaa\ aaaaaaa\ 0000\ aaa\ aaaaaa\ aaaaaaaaa/0000\ aaa\ aaaaaa\ –\ aaaaaaa.aaaaaaaaaaaaa/ 0000.aaaaaaaaaaaaa/aaaaaaaaa/0/00AA00AA-00A0-0AA0-0000-000AA0AA00A0.jpg

@algor
Copy link

algor commented Feb 20, 2023

Not sure about all the cases, but at least the issue I encountered resulting in this error is in the python code of the script, not in exiftool. The script always tries to parse json output of exiftool using the fixed buffer of size 4096. If a multibyte unicode character happen to be split and has its bytes in different slices the utf-8 decoding of the buffer fails.

@egaudry
Copy link

egaudry commented Feb 5, 2024

Setting the fixed buffer to 8192 can help to reduce the odds to observe this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants