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

Endless loop on broken images #10

Merged
merged 1 commit into from
Feb 7, 2013
Merged

Endless loop on broken images #10

merged 1 commit into from
Feb 7, 2013

Conversation

mibe
Copy link
Contributor

@mibe mibe commented Jan 17, 2013

I've experienced an endless loop with some images. I nailed it down to the exception handling in line 1733. I've changed that line to exit the function instead of trying again. That fixed the endless loop, at least for me.

I've added the broken images I had to deal with into the branch "broken-images" in my fork.

Here's my script I tested the change with:

import EXIF
import os

dir = "my_directory"

for root, dirs, files in os.walk(dir):
    for name in files:
        file = os.path.join(dir, name)
        print "Loading {0}".format(file)
        f = open(file, 'rb')
        tags = EXIF.process_file(f)
        for tag in tags.keys():
         if tag not in ('JPEGThumbnail', 'TIFFThumbnail', 'Filename', 'EXIF MakerNote'):
             print "Key: %s, value %s" % (tag, tags[tag])
        f.close()

ianare added a commit that referenced this pull request Feb 7, 2013
Endless loop on broken images
@ianare ianare merged commit 48a76d8 into ianare:master Feb 7, 2013
@ianare
Copy link
Owner

ianare commented Feb 8, 2013

I've created a new repo for test images and have added your samples.

https://github.com/ianare/exif-py-tests

In the future I will add some testing scripts as well.

Thanks for your help!

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

Successfully merging this pull request may close these issues.

2 participants