Extract JPG Thumbnails from multiple JPGs to "some" folder

Started by hvdwolf, September 29, 2020, 01:18:53 PM

Previous topic - Next topic

hvdwolf

Hi,
I know how to extract thumbnails from JPG
For 3 images (for example) I simply do
exiftool -a -m -b -W %d%f_%t%-c.%s -preview:ThumbnailImage a.jpg b.jpg c.jpg
For a folder I do:  exiftool -a -m -b -W %d%f_%t%-c.%s -preview:ThumbnailImage .

But how do I save them to another folder like /tmp ?
As %d in above command is the directory (and %f the filenamw), I tried things like: exiftool -a -m -b -W '/tmp/'%f_%t%-c.%s -preview:ThumbnailImage .
where I tried /tmp/, '/tmp/' and a few more
I tried above commands also with options like  '-directory=/tmp'
But all unsuccessful (otherwise I would not have this question :) )

So my question:  Is this possible OR what am I doing wrong?

Edit: I know the exiftool -b -ThumbnailImage image.jpg > thumbnail.jpg, which means I would have to loop through all the images, which is not really efficient, but if nothing else is possible I will do this.
See my jExifToolGUI cross-platform java application (Website, Releases, Changelog) for Phil's marvelous exiftool.

StarGeek

Replace the %d with the path you want to use.  That is the token that indicates the directory of the current file.
"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

hvdwolf

Quote from: StarGeek on September 29, 2020, 01:56:50 PM
Replace the %d with the path you want to use.  That is the token that indicates the directory of the current file.

Sorry, but I thought that is what I mentioned in my post and showed in my command?
QuoteAs %d in above command is the directory (and %f the filenamw), I tried things like: exiftool -a -m -b -W '/tmp/'%f_%t%-c.%s -preview:ThumbnailImage .
Am I overlooking something?
See my jExifToolGUI cross-platform java application (Website, Releases, Changelog) for Phil's marvelous exiftool.

Phil Harvey

Quote from: hvdwolf on September 29, 2020, 01:18:53 PM
exiftool -a -m -b -W '/tmp/'%f_%t%-c.%s -preview:ThumbnailImage .

This should work on Mac/Linux.  Without the quotes it should work on all operating systems. I tested it here and it works fine for me.  Why do you say it doesn't work?  What messages does ExifTool give?

- 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 ($).

StarGeek

Quote from: hvdwolf on September 29, 2020, 02:06:48 PM
Sorry, but I thought that is what I mentioned in my post and showed in my command?

Sorry, I didn't read carefully enough.  But as Phil said, that would be the format.  Maybe a permission problem?
"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

hvdwolf

I'm sorry.

I used the command, but probably with a typo or something like that, and it didn't work.
Then I used exiftool -a -m -b -W %f_%t%-c.%s -preview:ThumbnailImage . '-directory=/tmp' (so without the replaced %d but with a destination directory).
This moved the JPGs in the folder into /tmp, but I thought it had copied them and didn't check the source folder carefully enough.

So I used the previous command exiftool -a -m -b -W '/tmp/'%f_%t%-c.%s -preview:ThumbnailImage . again (and again with *.jpg instead of .), but never checked whether the jpgs were still in the folder. I only checked if the thumbnails were created in /tmp.

I am sorry for wasting both of your time.
See my jExifToolGUI cross-platform java application (Website, Releases, Changelog) for Phil's marvelous exiftool.