I have been using Exiftool for quite a while. I have been calling it in what I have always considered a kludgy way.
Using PowerBasic I call it this way: SHELL (ENVIRON$("COMSPEC") + " /C exiftool.exe " + EXIF_FILE + " > EXIF_OUTPUT.TXT", 0)
This works but is very slow.
I see there is no DLL so I am assuming that calling the entire program is the only way to interface to it?
Could someone explain what the preferred way to use exiftool as a resource for my program?
Does exiftool have to be present on the computer or can the functionality be compiled into my program?
I'm guessing you're calling exiftool for each and every file? That's Common Mistake #3 (https://exiftool.org/mistakes.html#M3).
You don't mention what you're calling from. Is it a programming language like Python? If so, look to see if there's a exiftool wrapper such as pyExiftool (http://smarnach.github.io/pyexiftool/) or C++ Interface (https://exiftool.org/cpp_exiftool/) for that language (see here (https://exiftool.org/#related_prog)).
Otherwise, what you'll want to do is use the -stay_open option (https://exiftool.org/exiftool_pod.html#stay_open-FLAG), -@ (Argfile) option (https://exiftool.org/exiftool_pod.html#ARGFILE), and the -execute option (https://exiftool.org/exiftool_pod.html#execute-NUM) too keep exiftool running until you shut it down.
OK - I am starting to see what you are saying.
You can have an interactive conversation with exiftool.
Does the tag data still get written to a file or can it be streamed, pipped to my control program?
I am using the PowerBasic compiler - I will post code once I get it working...
Thanks!
Typically the exiftool output would be piped directly to your control program. There should be examples of this here (https://exiftool.org/#related_prog).
- Phil
There's some VB code examples if you search here in the forum. I don't know how that compares to Powerbasic, though. I'm not familiar with either.
I can't really answer your other question as I've never used that option. But I'm sure something can be done. Imatch (https://www.photools.com/) for example, runs about four instances of exiftool while it's running.
Here's an example (https://exiftool.org/vb_sample.html)
Let me ask the question a different way.
Assume I am running exeftool in a "dos box / console" in windows
I am trying to have an interactive conversation with exiftool in the console window.
I ask because I want to be sure my exeftool commands are correct before I go to piping in and out.
Steps taken:
Open command window and change to directory with exeftool and some test image files.
I Type > exiftool test.jpg -stay_open 1 -
Then I get what I assume is an exiftool "ready for input" ======== -
After that no mater what I do nothing happens...
I tried -execute,
My question is how would I do the followning
Start exiftool with no file, just tell it to "get ready to receive commands"
Feed it a file name of an image.
Get back the image data
Feed it a file name of an image.
Get back the image data
etc...
Tell exiftool to close.
Can I do that by hand in the console and then the same thing using pipes?
You forgot the -@
Try this:
exiftool -stay_open 1 -@ -
- Phil
Thanks!! That did it.
Looks like in dos box you have to type -stay_open CRLF 0 to end...
Yes. In fact, in any usage. This is outlined in the step-by-step instructions in the app documentation for the -stay_open option.
- Phil
Thank you very much for the help!!
Now I am off to work out my side of things...