Changing Metadata breaks Windows Explorer showing thumbnail

Started by axel.hennig, April 07, 2025, 07:05:11 AM

Previous topic - Next topic

axel.hennig

@FrankB: Thanks for the hint, but didn't solve the problem.

axel.hennig

Even Windows Explorer Properties is not able to show EXIF-information.

Could it be that ExifTool puts in some "offset" into the metadata that my Windows version is no longer able to read that file?

On the left-hand side the "unproblematic" image and on the right hand-side the slightly metadata-adjusted one.

sc1.jpg

FrankB

Too bad. Just a suggestion.

Did some more investigation. On my Laptop (Win11) the 01-copy doesn't show a thumbnail, not in Windows explorer, nor in ExifToolGui. On my Desktop (Win10) both images have a thumbnail. Please note that ExifToolGui uses the same API as Windows Explorer for displaying Thumbnails.
Also the 'Preview' (Bottom left) doesn't show an image for the 01-copy. The preview uses WIC (Window Imaging Component), and for JPG it uses the codecs mentioned earlier.

Maybe a pointer? The ExifTool -diff also shows that a 2  bytes 'Thumbnail offset' difference. Yet you only added 1 'p'. Could be ok, could be a hint.

Windows 10:
Win10.jpg

Windows 11:
Win11.jpg

Let me know if you want more details.

Frank

Phil Harvey

The 2-byte offset difference is because the EXIF/TIFF specification stipulates that offsets must be even.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

axel.hennig

Hi Frank, thanks for investing time in this.

Interesting, that on your Win11 it's also not working. I've checked this morning with a friends Laptop (also Win11) and there both files are okay.

Still, this sounds more like a Windows WIC problem and not like an ExifTool problem (independent of the ThumbnailOffset).

FrankB

My assumption is that it is related to the 'embedded thumbnail'. Here is what I did.

1. Copied 01 - copy.jpg to 01 - copy corrected.jpg
2. Using ExifToolGui I extracted the preview from the 'corrected.jpg'.
3. Using ExifToolGui I imported the extracted preview back. And then Windows 11 shows a thumbnail.


Here are the args commands Gui uses

2.Export (Please ignore the GUI specifics, irrelevant here)
-echo4
{ready31}
-CHARSET
FILENAME=UTF8
-v0
-overwrite_original
-sep
*
-m
-c
%.6f°
-API
WindowsWideFile=1
-API
WindowsLongPath=1
-API
GeoDir=C:\Program Files\ExifToolGUI\GeoLocation500
-b
-W!
.\%d\%g1\%t\%f.%s
-IFD1:ThumbnailImage
01 - Copy _Corrected.jpg
-execute31

3. Import
-echo4
{ready36}
-CHARSET
FILENAME=UTF8
-v0
-overwrite_original
-sep
*
-m
-c
%.6f°
-API
WindowsWideFile=1
-API
WindowsLongPath=1
-API
GeoDir=C:\Program Files\ExifToolGUI\GeoLocation500
-IFD1:ThumbnailImage<=C:\Users\tdb.BIJNEN\AppData\Local\Temp\ExT9D7A.tmp\ExifToolGui_Preview.jpg
-IFD1:ImageWidth=120
-IFD1:ImageHeight=160
01 - Copy _Corrected.jpg
-execute36


FrankB

And here is the diff afterwards. Looks like the import set the image dimensions of the embedded thumbnail.

Phil Harvey

Yes, your import command specifically set IFD1:ImageWidth/Height.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

FrankB

Quote from: Phil Harvey on April 08, 2025, 10:23:12 AMYes, your import command specifically set IFD1:ImageWidth/Height.

- Phil

I should have added "and that makes a difference". Just executing this on the JPG makes it show a thumbnail. Without Exporting and importing.

exiftool -IFD1:ImageWidth=120 -IFD1:ImageHeight=160 "01 - copy.jpg"

axel.hennig

Thanks Phil and Frank.

The above mentioned commands led me to test the following command:

exiftool.exe -overwrite_original -all= -tagsfromfile @ -all:all -unsafe -icc_profile -F 02.jpg

Now, the thumbnail is also visible and the "-diff" command delivers (02.jpg not working | 03.jpg working again):

======== diff < D:/z_tmp/work/02.jpg > D:\z_tmp\work\03.jpg
< [System]        File Name                      : 02.jpg
>                                                : 03.jpg
< [System]        Directory                      : D:/z_tmp/work
>                                                : D:\z_tmp\work
< [System]        File Modification Date/Time    : 2025:04:07 21:49:00+02:00
>                                                : 2025:04:08 18:31:55+02:00
< [System]        File Creation Date/Time        : 2025:04:07 21:44:50+02:00
>                                                : 2025:04:08 18:27:55+02:00
< [File]          Current IPTC Digest            : 7443065fec988d8e02f1604d3ea45292
>                                                : 7ef3093a28ab4482519c19b0c836608c
< [IFD1]          Thumbnail Offset               : 1888
>                                                : 1906
< [JFIF]          JFIF Version                   : 1.01
>                                                : 1.02
< [Photoshop]    IPTC Digest                     : 7443065fec988d8e02f1604d3ea45292

So, looks like I'm "just" loosing the "Photoshop:IPTCDigest" value.

FrankB

Good that you found that, but I'm confused. To me the -ifd1:imageWidth/Height tags are not related to the Photoshop:IPTCDigest, yet they both seem to work. I have checked but 'fixing' the JPG with the ImageWidth/Height did not change the IPTCDigest values.

But the question remains: Are the JPG's valid and is this something that should be fixed by MS? (WIndows) If yes, you can now describe the problem better.

StarGeek

Quote from: axel.hennig on April 08, 2025, 04:11:39 AMIf you are willing to do that and run the WIC diagnosis on that image (IMatch -> Help -> Support -> WIC Diagnostics...), does it also fail?

A little late getting back to this, but here's the result, snipping all the codec listing except for jpeg

List of installed WIC codecs:

WARNING:
    You have the 'FastPictureViewer Codec Pack' installed.
    These codecs are no longer maintained and many years out of date. They can cause problems with modern RAW formats produced by cameras released over the past couple of years.
    You might want to consider uninstalling these codecs via the Windows Control Panel.


<snip>
    Codec 'JPEG Decoder' (Vendor: F0E749CA-EDEF-4589-A73A-EE0E626A2A2B) for extensions .jpeg,.jpe,.jpg,.jfif,.exif

<snip>

WIC: Testing file 'Y:\!temp\x\y\image\01 - Copy.jpg'
    Thumbnail: Codec 'JPEG Decoder'
        (GetThumbnail failed (88982F44 The bitmap codec does not support a thumbnail.).) 0x0 pixel in 0 ms.
    Preview: Codec 'JPEG Decoder'
        (GetPreview failed (88982F81 The operation is unsupported.).) 0x0 pixel in 0 ms.
    Full resolution: Codec 'JPEG Decoder'
        () 1704x2272 pixel in 15 ms.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

FrankB

I have some more info. The short story is that the 'WindowsCodecs.dll' (and possibly WindowsCodecsExt.dll) from the standard Windows 11 (OS Build: 26100.2894) will not show a thumbnail while older versions will.

I DONT recommend performing these actions on a production system. They were just performed to pin down the culprit.

Here is what I did.
- Installed Windows 11 in a Virtual Environment (virtualbox)
- ONLY ExifTool(GUI) were installed, for the rest WIN11 was 'virgin-like'.
- Copied the JPG to the desktop. (The one not showing a ThumbNail)
- Verified that it did not show a thumbnail.
- Then I copied the WindowsCodecs.dll and WindowCodecsExt.dll from a Windows 10 machine to this Virtual machine.
  It wasn't as easy as it sounds. I had to take ownership, change the permissions, kill Explorer and copy from an Administrator prompt before Windows would let me do it.
- After restarting Windows11 it did show a thumbnail.

Looks to me something MS should fix. I wish you the best of luck reporting this issue.

The Windows 11 version not working:
Win11.jpg

The Windows 10 version working:
Win10.jpg


axel.hennig

Dear Frank,

thanks again for further investigation. I think you've clearly nailed it down to what's exactly happening.

Just fyi: My current version of WindowsCodecs.dll is 10.0.26100.3624

I've made a bug report within the "Feedback Hub" app within Windows (not completely sure, but I think that's the way how to report bugs).

FrankB

Good luck.
Looking forward to any progress on this. The matter has my interest as you may have noticed.