1
\$\begingroup\$

When I scanned in some 4"x6" photographs, my scanner produced jpg image files for the full 8.5"x11" bed of the scanner. I used XnView MP to crop the images, but now both XnView MP and Adobe Bridge show the uncropped images in grid view. Telling Adobe Bridge to purge its cache does not solve the problem for Bridge, and telling XnView MP to rebuild its thumbnails does not solve the problem for XnView MP.

Windows 10 File Manager correctly shows the cropped images in icon view. FastStone Image Viewer correctly shows the cropped images in grid view.

Using exiftool to extract the embedded thumbnail from a file (exiftool -b imageFile.jpg >thumbnail.jpg) doesn't seem to yield a viewable jpg file.

I don't know if I'm dealing with a problem with the embedded thumbnails in the jpg files, if it's something to do with thumbnail caching in Bridge and XnView MP, or if I'm barking up the wrong tree entirely. Help?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ You command is missing a -ThumbnailImage parameter: exiftool -b -ThumbnailImage Image.jpg >Image-thumbnail.jpg \$\endgroup\$
    – xenoid
    Sep 30, 2023 at 7:33
  • \$\begingroup\$ Adding the -ThumbnailImage parameter doesn't help. The resulting jpg can't be displayed by Windows 10 or by XnView MP ("File can't be loaded!"). It's only 4KB in size. \$\endgroup\$ Sep 30, 2023 at 18:28
  • \$\begingroup\$ As noted in StarGeek's answer below, piping exiftool's binary output into a file under PowerShell (which I was using) doesn't work. That's why my adding -ThumbnailImage didn't fix the problem. Per StarGeek's advice, using CMD instead of PowerShell successfully extracts the thumbnail from the jpg file when -ThumbnailImage is specified. \$\endgroup\$ Oct 1, 2023 at 20:33

2 Answers 2

2
\$\begingroup\$

There are several locations that a preview image be in a file. Try using this exiftool command to extract all preview images from the file.

exiftool -a -b -W %d%f_%t%-c.%s -preview:all /path/to/files/

The reason your first command failed, as the comments had pointed out, that you didn't name the tag you wanted to extract. The result was a binary dump of every tag in the file.

Additionally, make sure you are using CMD, not PowerShell, as some versions of PS will corrupt binary data that is piped or redirected into a file. See this Exiftool forum post.

With XNView, you can rebuild the embedded thumbnails. Under the Tools menu you would use
[

\$\endgroup\$
1
  • \$\begingroup\$ +1 for your observation that when piping binary output from ExifTool into a file, CMD has to be used instead of PowerShell. I was using PowerShell, and switching to CMD fixed the problem I was having. I would never have found this obscure problem on my own! \$\endgroup\$ Oct 1, 2023 at 20:36
0
\$\begingroup\$

The problem turned out to be that the embedded thumbnails in the jpgs were of the uncropped images. While

exiftool -b -ThumbnailImage image.jpg > thumbnail.jpg

failed to produce a file that image viewing programs could make sense of (because, as StarGeek explained in their answer, I was using PowerShell instead of CMD),

exiftool -a -b -W Thumbnails/%f_%t%-c.%s -preview:all *.jpg

did the job and allowed me to verify that the embedded thumbnails were the problem. (Thanks to this discussion for the approach.)

I got rid of the embedded thumbnails (plus any preview images, for good measure) this way,

exiftool -thumbnailimage= -previewimage= *.jpg

and then XnView MP showed proper images in browser mode. Adobe Bridge did, too, once I forced it to purge its cache.

Next up will be generating and putting accurate thumbnails back in the jpgs, but that's a problem for another day. (I know that exiftool can do it.)

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.