Hello
I'm using a batch file to run ExifTool with a custom config file:
...
REM assign date time string: yyyymmdd_hhnnss
set DT=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
set DT=%DT: =0%
...
ExifTool -config ExifTool_ImageMagickThumbMWG_THUMBS.config -G1 -a -s -IMCommandMWG -api requestall -@ ExifTool_ImageMagickThumbMWG_ARGS.args -T ImageFolder -r -w ImageFolder_BATCH_!DT!/%%f_%%.9nC.bat -b
...
Here the destination folder has a datetime suffix given by '_!DT!'.
Is it possible to somehow send !DT! as an argument to the config file?
I know I can get datetime value (from 'Now') within the config file but I need it to be a fixed value and not updated for each file that is processed.
Regards
Michael
You can pass a value to the config file by using the -userParam option (https://exiftool.org/exiftool_pod.html#userParam-PARAM-VAL). See the UserParam API entry (https://exiftool.org/exiftool_pod.html#userParam-PARAM-VAL).
That's great, thanks very much. Have now achieved what I was after. Got it working using your forum post
GPS2MapUrl user defined tags as an example.
Here's what's working for me:
command batch file:
...
REM assign date time string: yyyymmdd_hhnnss
set DT=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
set DT=%DT: =0%
...
ExifTool -config ExifTool_ImageMagickThumbMWG_THUMBS.config -G1 -a -s -IMCommandMWG -userparam dt=!DT! -api requestall -@ ExifTool_ImageMagickThumbMWG_ARGS.args -T ImageFolder -r -w ImageFolder_BATCH_!DT!/%%f_%%.9nC.bat -b
...ExifTool_ImageMagickThumbMWG_THUMBS.config:
...
#------------------------------------------------------------------------------
%Image::ExifTool::UserDefined = (
'Image::ExifTool::Composite' => {
...
IMCommandMWG => {
...
ValueConv => q {
...
my $datetime = $self->Options('UserParam')->{'dt'};
print "$datetime\n";
},
},
},
);
#------------------------------------------------------------------------------
1; #end
Thanks also to user
grimmo and yourself for the post
Extract an jpg image corresponding to the face detected area from digikam.
Regards
Michael
GPS2MapUrl user defined tags | https://exiftool.org/forum/index.php?topic=9862.0 (https://exiftool.org/forum/index.php?topic=9862.0) |
Extract an jpg image corresponding to the face detected area from digikam | https://exiftool.org/forum/index.php?topic=10879.0 (https://exiftool.org/forum/index.php?topic=10879.0) |
Glad you figured it out.
I didn't think anyone would be using that imagemagick config. It is on my list to enhance it, to call Magick directly and either save the thumbs, or have the thumbnails passed directly back to exiftool and they could be saved using the -W (-TagOut) option (https://exiftool.org/exiftool_pod.html#W-FMT--tagOut), similar to the example command (https://exiftool.org/exiftool_pod.html#exiftool--a--b--W-d-f_-t--c.-s--preview:all-dir) that saves out the preview images.
That would be great and many thanks for your help.
For now, I've managed to cobble together some code (from yourself and others) which does 2 things:
- Writes a summary csv file listing all files and their face regions if they have them
- Creates a separate directory hierarchy of extracted face thumbnail images
Reason for all this is to identify image face regions after using "Write Faces to XMP" in Picasa.
In case this is of interest to anyone I have attached relevant files:
ExifTool_ImageMagickThumbMWG_ARGS.args |
ExifTool_ImageMagickThumbMWG_COMMAND.bat |
ExifTool_ImageMagickThumbMWG_PEOPLE.config |
ExifTool_ImageMagickThumbMWG_THUMBS.config |
REQUIREMENTExifTool
ImageMagick (either installed or system environment variable 'Path' pointing to portable version folder)
Windows
SETUPExifTool.exe should be placed next to (ie at same level) as source folder/directory of files to be processed.
Attached files should be placed at same level as source folder.
Edit 'ExifTool_ImageMagickThumbMWG_COMMAND.bat' to change name of source folder (search for 'set SOURCE_FOLDER=').
RUNDouble-click on 'ExifTool_ImageMagickThumbMWG_COMMAND.bat'.
OUTPUTNew files and folders are created at same level as source folder:
sourcefolder_PEOPLE_datetime.csv | .......... | summary csv file listing |
sourcefolder_BATCH_datetime | .......... | folder of batch files for all images found with face regions |
sourcefolder_THUMBS_datetime | .......... | folder hierarchy of extracted face thumbnail images |
NOTESAdvise back up of original image files.
Advise experimenting on test hierarchy of images.
My code probably not very pretty but all works OK on my system.
DISCLAIMERUse at own risk.
updated files attatched...
ExifTool_ImageMagickThumbMWG_THUMBS.config renamed to ExifTool_ImageMagickThumbMWG_THUMB.config
ExifTool_ImageMagickThumbMWG_COMMAND.bat edited
- added output file report
- added date time subroutine
- various other tweeks