musicbrainz/picard — pull request #66 by mineo (2012-08-23 13:06:41+00:00)
Title: Prevent cover images from skipping even numbers

This is a bug introduced with fc7470eee076c06d925598d3f29e7eca7cb089c6:
When saving multiple images with the generic filename, only odd numbers
would be appended to the filename, because the "while exists(foo)" check
is always true for every image except the first one at least once,
causing "i" to be incremented twice for every image (except for the
first one).

I believe this will still cause the code to skip a few "i"s when there's a mixture of generic and specfic (as in, specified in the call to `add_image`) filenames because "i" will be incremented for the specific filenames even if that's not necessary.