richq / folders2flickr

Upload files to flickr
Other
102 stars 38 forks source link

EXIF fails to read for certain Canon photos #16

Closed i814u2 closed 10 years ago

i814u2 commented 10 years ago

I have a number of photos, from at least one Canon camera (if not others), which fail when attempting to read for upload.

They fail because, apparently, Canon writes makernotes a little differently than most do. At least that's what I gather after a bit of research.

I attempted to "fix" the issue using exiftool but it still existed. After more research, I came upon a newer version of the exif.py included in this project. https://github.com/ianare/exif-py

Check that out, and maybe it could be incorporated into a new release of folders2flickr.

It is no longer a single file, so simply updating this project won't be an option. I'm new to python or I'd do it myself and submit the change. I've hacked it together for my own purposes but I honestly do not feel 100% certain about my methods. If nothing else, they were not clean (I copied files to multiple places in order to avoid compile errors, etc).

If I get some time, I could retry my efforts. For now, I thought I'd enter an issue so it gets tracked and perhaps properly implemented.

If there are any tips for me, to get me pointed in the right direction, I'm willing to help get things updated.

richq commented 10 years ago

I spotted that, that the upstream project has advanced a lot. I plan to start doing proper tar-ball releases, tagging master, etc. so I can get rid of the dependencies in the repo, and update that exif.py with that project (as a dependency, not encrusted here).

However... after you hacked in the new version, were your Cannon EXIF photos recognized? No point doing all the work if it didn't function correctly anyway :)

i814u2 commented 10 years ago

I'm doing a better test right now. It does seem to have fixed the issues, but I had also messed with the files (using exiftool, as mentioned originally). I made new copies of the files from my backups, renamed the folder to create a new set, and I'm testing again. I'll update in a few minutes when it's complete. So far, the files appear to be uploading without issue.

i814u2 commented 10 years ago

hmm. Now I appear to have a new error, on some files only.

This test folder is a mix of photos from different cameras (as an attempt at a better best). I also know that most of them previously failed.

So my test ran, uploaded 21 files, created a set, and then started on the last 4 files. Of those, 3 uploaded, 1 failed.

I copied some of the photos from the same camera/set as the failed photo into the folder as well. Those files had also previously failed, before the python work I did.

I re-ran folders2flickr and both new photos uploaded, but the failed one still failed. This failure is a syntaxerror which mentions string. I haven't looked any further yet but I assume it's due to the new exif python code.

Related to my other issue (#15), the existing set was not used for the next run offolders2flickr. So I have a new test set with 21 photos, but between the two runs, I uploaded 26 photos.

Quick recap of the upload counts: Attempt 1 21 uploaded set created, 21 added 3 uploaded (not in a set) 1 failed Attempt 2 1 uploaded (not in a set) 1 failed (same file as 1st attempt) 1 uploaded (not in a set)

i814u2 commented 10 years ago

Here is a link to the debug.log info (user ID redacted, but was correctly listed in the original):

http://pastebin.com/nWThE0tv

richq commented 10 years ago

Now I've released v1.00 I'm going to have a go at refactoring a bit to get rid of the old exif.py and pull in the new one without having it in the repo.

richq commented 10 years ago

This should be fixed now as v1.1 uses an external python-exif, exif-py, exifread rather than the built in one.