Export Thumbnails by Batch Script

Started by scharott, May 05, 2010, 06:17:09 PM

Previous topic - Next topic

scharott

Hello,
I'm not yet familiar with exiftool and Batch-programming.
I've seen the example about extracting Thumbnails file by file, but I want to do it in a directory.

I created a batch script (win-xp) with this line:

---------
for %%a in ("%converted_path%\*.*") do (%exiftool% -v0 -b -ThumbnailImage "%%a" > %batchwork_path%\%%f_Thumb.jpg)
---------

At the end I have only one file (the last thumbnail.jpg) with this name:  "%f_Thumb.jpg" in my export-directory. I think, the script will export any thumbnail, but with the same name and it overwrites the former file.

I tried it with %%%f, %%f, %%f for the original filename, but it will not accepted.

Hope you can help me, what is wrong.

Sorry, if my English is bad, but I'm from Germany and school is 40 years ago.

Thanks
scharott

Phil Harvey

You don't need a for loop.  Just do this:

exiftool -thumbnailimage -b -w _Thumb.jpg DIR

Where DIR is the directory name.

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

scharott

wow !

it's so easy - and I'm looking in 10 tunnels to see the light at the end!!

Thank you very much!

scharott

evilaro

Phil:

I am not getting this one ?

Does it means you get the thumbnail of  _Thumb.jpg  (1 image only) to a specified DIR ?
Even if that is so, I am  not getting it... I must be doing something wrong.

ANy way, is it possible to get ALL thumbnails of a Original_DIR to Thumb_DIR ??

Thanks
Emilio



Quote from: Phil Harvey on May 06, 2010, 07:05:20 AM
You don't need a for loop.  Just do this:

exiftool -thumbnailimage -b -w _Thumb.jpg DIR

Where DIR is the directory name.

- Phil

www.evilfoto.eu
*************

Phil Harvey

For each image containing a thumbnail in directory DIR, this command will create a new file called FILE_Thumb.jpg in the same directory.

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

evilaro

Phil:

Thanks for the clarification I did not get the meaning... now it works.

But I wonder if it could be possible to create the thumbnails into a different DIR
the reasons for that is:

1) Some users do not like that I put things on their folders.. (of course I can copy them some other place and then delete them)
2) I wanted to use this feature to see the thumbnails from a memory card, and even if the thumbnails are small
   I am not sure if when the memory is full I could have problems.

Thanks

Emilio


Quote from: Phil Harvey on May 18, 2011, 06:19:33 AM
For each image containing a thumbnail in directory DIR, this command will create a new file called FILE_Thumb.jpg in the same directory.

- Phil
www.evilfoto.eu
*************

Phil Harvey

use -w SOMEOTHERDIR/%f_Thumb.jpg to write the thumbnails to another directory.

This is all explained in the -w option documentation.

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

evilaro

Phil:

Thanks  that should do the job.

Emilio


Quote from: Phil Harvey on May 19, 2011, 10:26:20 AM
use -w SOMEOTHERDIR/%f_Thumb.jpg to write the thumbnails to another directory.

This is all explained in the -w option documentation.

- Phil
www.evilfoto.eu
*************