Why does Explorer show a thumbnail for my image that’s different from the image?


A customer (via a customer liaison) reported that Explorer somestimes showed a thumbnail for an image file that didn't exactly match the image itself.

I have an image that consists of a collage of other images. When I switch Explorer to Extra Large Icons mode, the thumbnail is a miniature representation of the image file. But in Large Icons and Medium Icons mode, the thumbnail image shows only one of the images in the collage. I've tried deleting the thumbnail cache, but that didn't help; Explorer still shows the wrong thumbnails for the smaller icon modes. What is wrong?

The customer provided screenshots demonstrating the problem, but the customer did not provide the image files themselves that were exhibiting the problem. I therefore was reduced to using my psychic powers.

My psychic powers tell me that your JPG file has the single-item image as the camera-provided thumbnail. The shell will use the camera-provided thumbnail if suitable.

The customer liaison replied,

The customer tells me that the problem began happening after they edited the images. Attached is one of the images that's demonstrating the problem.

Some image types (most notable TIFF and JPEG) support the EXIF format for encoding image metadata. This metadata includes information such as the model of camera used to take the picture, the date the picture was taken, and various camera settings related to the photograph. But the one that's interesting today is the image thumbnail.

When Explorer wants to display a thumbnail for an image, it first checks whether the image comes with a precalculated thumbnail. If so, and the thumbnail is at least as large as the thumbnail Explorer wants to show, then Explorer will use the image-provided thumbnail instead of creating its own from scratch. If the thumbnail embeded in the image is wrong, then when Explorer displays the image-provided thumbnail, the result will be incorrect. Explorer has no idea that the image is lying to it.

Note that the decision whether to use the image-provided thumbnail is not based solely on the view. (In other words, the conclusion is not "Explorer uses the image-provided thumbnail for Large Icons and Medium Icons but ignores it for Extra Large Icons.) The decision is based on both the view and the size of the image-provided thumbnail. If the image-provided thumbnail is at least the size of the view, then Explorer will use it. For example, if your view is set to 64 × 64 thumbnails, then the image-provided thumbnail will be used if it is at least 64 × 64.

The Wikipedia page on EXIF points out that "Photo manipulation software sometimes fails to update the embedded information after an editing operation." It appears that some major image editing software packages fail to update the EXIF thumbnail when an image is edited, which can result in inadvertent information disclosure: If the image was cropped or otherwise altered to remove information, the information may still linger in the thumbnail. This Web site has a small gallery of examples.

Comments (21)
  1. Adam Rosenfield says:

    The thumbnail in the EXIF data was immediately my first thought as well (though I was unaware of the rule Explorer used for deciding whether or not to use that thumbnail).  For once my psychic powers are in line with Raymond's!

  2. Joshua Ganes says:

    I occasionally capture screenshots and crop them to share the image with other people. Not that I really have anything to hide, but I wouldn't want to give unwanted info away in the metadata.

  3. NB says:

    It's like Word's revision history back in the day! :)

  4. David Crowell says:

    I used to sell a shareware product that would remove EXIF (and other data) from JPEG files.  It fixed this issue.

    I've since made it freeware and longer update it, but that's a different matter.

  5. GWO says:

    There's also the converse problem: an editing program performs an image transformation by modifying only the EXIF, and then another app comes along that fails to honour this. This is what happens if I rotate an image in GNOME/F-Spot, and then copy it onto a memory card for use in my el-cheapo digital picture frame.  What a Royal pain.

  6. jader3rd says:

    Now if only Explorer would listen to the Exif data on how the picture should be rotated the world would be a much better place.

  7. Joshua says:

    Nice! Blame Microsoft, it's the easy way out.

  8. dasuxullebt says:

    This is a perfect example of how formats are being over-engineered to make them more user friendly, at the cost of usability. While I consider automatic thumbnailing in an ordinary system file manager as a big security issue anyway (I remember that about one year ago, even Windows had a security hole), and a user can just use an image viewer that does thumbnailing (which is a big difference, since then he explicitly requests seeing the images, instead of just opening a folder), putting that kind of meta information into a file without somehow trying to enforce its correctness (or trying to make it harder not to support it properly than to support it properly) sounds just plain stupid to me. Bad enough that geolocation data may be put into the meta data of images.

    Having this default behavior in the Explorer seems ok to me, but I would expect that there is a way to change it, is there one?

  9. James Schend says:

    "Psychic Powers" seems to just be awareness of all of Windows' various features.

  10. Troll says:

    In Windows XP, thumbnails could be forced to refresh by right clicking and selecting "Refresh thumbnail" from the context menu. In the horrible Vista/7 OSes, thumbnails can no longer be forced to regenerate by right-clicking the image and selecting Refresh thumbnail. Why is this so? Many times the abominable Explorer fails to show a thumbnail at all and would then never generate a thumbnail for that image/video even after clearing the thumbnail cache.

  11. Jules says:

    I have a number of interesting examples that I've collected in various places on the web, including one where the main image shows a single person posing against a coloured background but the thumbnail shows a second person behind them and with their arm wrapped around the first person's waist.

  12. Someone says:

    I would argue that the behavior of the Explorer is needlessly inconsistent. Why it is relying at the embedded icon under some obscure circumstances, but not *always* ? Given that Explorer is able to generated this icons on its own, it would be better to always generate the icons, regardless of icon dimensions, and to replace the EXIF icons in the Explorer view with the self-generated icons as soon as they are available.

    [This suggestion makes the assumption that bandwidth is free. -Raymond]
  13. Skyborne says:

    @jader3rd – if the pixel data and EXIF info disagree, there's no right answer.  Displaying the pixel data as-is will always be the faster choice, though.

    Also watch out for edge cases where the rotation sensor on the camera lied (especially happens while shooting up/down) and rotating the image based on the EXIF data will produce incorrect results.  Likewise with editing software that rotated the pixel data, but didn't update the EXIF rotation.

    I've seen image editors display an un-rotated thumbnail, only to rotate it correctly when actually opening the image.  That can be confusing, too.

    In my younger days, I wrote a script to normalize the rotation (and update EXIF) when copying files from my memory card to my hard drive.  Between that and fixing mis-rotated images in-camera, I no longer have images of my own that are incorrectly rotated. ;)

  14. jader3rd says:

    @Skyborne

    My experience has been that every device (camera, photo frame, etc) uses the EXIF data. The only two things which rotate the pixels instead of updating a meta data tag are Explorer and Windows Live Photo Gallery. The result is that if you rotate a picture in Explorer the devices can no longer understand the picture. Resulting in your mother complaining to you for weeks about how you broke her camera, preventing her from showing a couple of pictures to her friends.

  15. Someone says:

    @Raymond: [This suggestion makes the assumption that bandwidth is free. -Raymond]

    This response is not constructive and make no sense to me; If you want to preserve bandwidth at all cost, you should not displays anything beyond the filename. Also, you do not take into account with this statement that a large amount of photo viewing takes place at home computers, not in the corporate network.

    [If you want to consume a reasonable amount of bandwidth, then you use the thumbnail when it is available. Companies often have corporate servers which hold lots of images. Not all JPGs are vacation pictures. (And networking is not the only low-bandwidth channel. Should Explorer read a 15MB image off your CDR just to refine the thumbnail?) -Raymond]
  16. Someone says:

    As in other disputes in this blog here about Explorer: The right answer would be an option to allow the user to toggle if the Explorer will always generate the thumbnail or not.

    Also, Raymond: Explorer will generate the previews in Extra Large Icon mode, so it seems that bandwidth saving is not the only answer here.

    [Ah, the checkbox, the mating call of the loser. The behavior with Extra Large Icons is is already covered in the article: Read the third-to-last and second-to-last paragraphs. Explorer conserves bandwidth by not trying to refine thumbnails. -Raymond]
  17. Jeremy Croy says:

    Always check the meta data, whether is be a document, picture, file, or anything else you publish.

  18. Someone says:

    "Explorer conserves bandwidth by not trying to refiner thumbnails."

    You have already made that statement, I understand you. But Explorer don't have to follow that goal, because the use case here for most of the Windows computers is "Home user is viewing his photo collection"., For this use case, it is better to show consistent behavior, and/or allow the user to refresh the thumbnails from the original image, than to "preserve bandwidth". Or introduce a setting for that (I can also repeat my statements, Raymond.)

    [I guess we have different definitions of consistent behavior. "How come the pictures on in my Pictures folder display thumbnails one way, but the pictures on my NAS storage display thumbnails a different way?" There are arguments on both sides. But at the end of the day, you have to pick a side. -Raymond]
  19. benjamin says:

    My favorite image "bug" (which, like most issues discussed here, isn't a bug at all) is how I had a bunch of images that I had looked corrupted when I moved to Vista & 7. Turns out that the preinstalled photoviewer correctly uses the XResolution paramater in the file, but the program that saved the images didn't set it correctly.

  20. Peter Yates says:

    Removing of metadata with the help of utilities such as EXIFCleaner — http://www.superutils.com/…/exifcleaner — solves this issue.

Comments are closed.

Skip to main content