Issue #28 resolved

Need more graceful way to end IFD iteration

created an issue

After pulling all recent changes, I am getting the following warnings on all exif image files.

"Unable to get entry[n] (and generator is already running)"

"Unable to get ifd[n] (and generator is already running)"

These warnings are unnecessary because 'entry[n]' never exists. For example, if an IFD has 12 entries, the last entry is 'entry[11]' and the warning says "Unable to get entry[12]." 'entry[12]' doesn't exist because there are only 12 entries, so the last entry is entry[11].

IMHO, a warning should only be issued if something is wrong. However, with the above warnings, nothing is 'wrong' with the image--the parser has simply reached the end of the entries (or IFDs). There should not be a warning in this instance.

Again, this happens with all exif jpg files.


Comments (2)

  1. nneonneo

    These warnings are generated by the calls to self.array(). Unfortunately, I don't know of a clean way to avoid the warnings; attached is a patch which attempts to avoid self.array, but ends up being a rather uglier solution to the enumeration problem.

    Victor, do you know of a clean way to make self.array() work without spurious warnings?

  2. Log in to comment