exiftool performance benchmark

Started by Phil Harvey, April 16, 2010, 11:25:53 AM

Previous topic - Next topic

Phil Harvey

From a program, just open todo.arg in append mode.

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

jean


jean

Is it possible to dialog with Exiftool.exe using pipes ?
I create a process with exiftool, then i create two pipes for reading from and writing to exiftool.
The read pipe uses stdoutput.
I can read the errors with the pipe but not the infos (Exif and so on).
Where are those infos returned by exiftool supposed to go  ???

Phil Harvey

If you use "-@ -", you should be able to handle all I/O with 3 pipes:

1) exiftool receives command-line arguments from STDIN

2) exiftool writes tag information to STDOUT

3) exiftool writes error messages to STDERR

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

jean

are you sure that stdin can be redirected ?

Phil Harvey

#35
Excerpt from a Bourne shell session to prove this works:

> ls -l a.jpg b.jpg
ls: b.jpg: No such file or directory
-rwxr-xr-x   1 phil  phil  281767 Nov 17 12:09 a.jpg

> cat a.arg
a.jpg
b.jpg
-filename

> cat a.arg | exiftool -@ - 1>std.out 2>err.out

> cat std.out
======== a.jpg
File Name                       : a.jpg
    1 image files read
    1 files could not be read

> cat err.out
File not found: b.jpg


- Phil

Edit: To make things easier to see, I could have redirected stdin directly from a file rather than piping the output of "cat".  The effect of this command is the same:

exiftool -@ - <a.arg 1>std.out 2>err.out
...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 ($).

jean

I meant redirecting stdin under Windows, creating a process for exiftools.exe and giving it pipes for stdin, stdout and stderr.
I can get stdout if i create the process giving parameters such as "-EXIF:All test.jpg"
In that case i don't use stdin.

but if i just create the process with "-@ -" i can(t give parameters using the pipe redirecting stdin

Phil Harvey

I'm not a Windows programmer, and I don't even know what programming language you are using, but redirecting stdin is very common, and it should be possible from any platform/language.

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

jean

Yes, i use redirecting since years with many programs, but i can''t make that work with Exiftools.
(I use C)

Phil Harvey

Sorry for the delay, but I had to wait until I got home to try this in windows:

exiftool -@ - <a.arg 1>std.out 2>err.out

This exact command works perfectly in the Windows cmd shell.  Undoubtedly this shell is written in C (or C++), so there must be some way for you to do this from C in Windows.

I'm thinking that maybe you are having problems because you aren't flushing the file piped to exiftool's stdin after writing?  Any write buffering by your program could put a wrench in the whole works (as noted in my -stay_open 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 ($).

jean

I'm going to investigate a little more, i will post my results  :)

A small bug: -lang does not seem to work:

exiftools.exe -lang it -EXIF:All test.jpg

returns:

Invalid or unsupported language 'it'
then the list of Available languages (with it)

Phil Harvey

Quote from: jean on November 19, 2010, 12:01:03 AM
Invalid or unsupported language 'it'
then the list of Available languages (with it)

It sounds like your exiftool installation is bad.  My guess is that lib/Image/ExifTool/Lang/it.pm is missing or corrupted.  Try re-installing.

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

jean

I recompile it, using pp.
I added it.pm in the file pp_build_exe.argc
When exiftool is launched it creates its temp folder, and in this temp folder it.pm is copied twice, one under
inc\lib\image\exiftool\lang and one under inc\lib

jean

I tried a lot of different manners, none works  ???
can you explain how you add a single line in the pp_build_exe.ergs ?

Phil Harvey

Attached is my current copy of pp_build_exe.args

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