ExifTool Forum

ExifTool => Newbies => Topic started by: hvdwolf on September 29, 2020, 01:18:53 PM

Title: Extract JPG Thumbnails from multiple JPGs to "some" folder
Post by: hvdwolf on September 29, 2020, 01:18:53 PM
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.
Title: Re: Extract JPG Thumbnails from multiple JPGs to "some" folder
Post by: 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.
Title: Re: Extract JPG Thumbnails from multiple JPGs to "some" folder
Post by: hvdwolf on September 29, 2020, 02:06:48 PM
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?
Title: Re: Extract JPG Thumbnails from multiple JPGs to "some" folder
Post by: Phil Harvey on September 29, 2020, 03:10:34 PM
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
Title: Re: Extract JPG Thumbnails from multiple JPGs to "some" folder
Post by: StarGeek on September 29, 2020, 03:33:20 PM
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?
Title: Re: Extract JPG Thumbnails from multiple JPGs to "some" folder
Post by: hvdwolf on September 29, 2020, 03:44:30 PM
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.