I've spent a lot of time testing this bug - hopefully it helps:
The number of thumbnails is variable, and so is the number of bytes processed. But the big problem certainly happens to all thumbnails after a particular point (although not only then - once I found a single uncorrupted thumbs in a long way into the corrupted thumbs, and once a single corrupt thumb in the middle of an uncorrupt directory).
Here's some stats I've compiled, in the format: Directory number (for reference), # images in directory, size of directory, # of partially-corrupt thumbnail (see tripgoth.jpg above), combined size of thumbnails below partially-corrupt thumbnail
1. 32, 852.69Kb, 31, 749.5Kb
2. 133, 1.16Mb, 29, 249.79Kb
3. 180, 16.13Mb, 39, 3.56Mb
It seems to be an error in the cache: I viewed the above directories in order. Directory 1:
Now, in directory 2, thumbnail #29 has a chunk of what appears to be #30 from directory 1. Thumbnails #33 onwards all look similar to #45 (a bunch of similarly spaced lines):
Directory 3 is like directory 2:
The thumbnails are corrupted on creation (I can see them created in corrupted form, it's not a later viewing error).
While testing this bug, I also found another: Directories with a certain number of images always recache (this may be something to do with the corrupt thumbnails, but there are directories with corrupt thumbnails with ~30 images which don't exhibit this behaviour). It happens in a directory with 180 images, and one with 133 images. However, I came across strange behaviour when I attempted to determine the exact number of images:
When I moved some files from the directory with 133 images, I found the directory continued to always recache, even when there were only 15 images! Then I moved another 6, and the remaining 7 didn't recache. Adding back 4, and it did recache. Then, I moved files one at a time, and the directory still recached with 5 images (4 didn't recache).
Interestingly, after all this moving around, I moved all the images back into the same directory again. Now all the images *before* #86 are corrupt. Then I do a manual recache (CTRL-F5) and #29 onwards are again corrupted, except for #86 onwards.
Doesn't look like I'm going to get much more useful information.