Could someone explain the "Big Picture" for using exiftool in an application.

Started by dc@eicx.com, January 03, 2021, 02:07:48 PM

Previous topic - Next topic

dc@eicx.com

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? 

StarGeek

I'm guessing you're calling exiftool for each and every file?  That's Common Mistake #3.

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 or C++ Interface for that language (see here).

Otherwise, what you'll want to do is use the -stay_open option, -@ (Argfile) option, and the -execute option too keep exiftool running until you shut it down.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

dc@eicx.com

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!

Phil Harvey

Typically the exiftool output would be piped directly to your control program.  There should be examples of this here.

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

StarGeek

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 for example, runs about four instances of exiftool while it's running.

Here's an example
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

dc@eicx.com

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?

Phil Harvey

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


dc@eicx.com


Looks like in dos box you have to type -stay_open CRLF 0 to end...

Phil Harvey

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

dc@eicx.com

Thank you very much for the help!!

Now I am off to work out my side of things...