Author Topic: cpp passing ImageInfo arguments  (Read 2123 times)

PaulWilliams

  • Newbie
  • *
  • Posts: 6
cpp passing ImageInfo arguments
« on: February 08, 2021, 06:49:32 PM »

  I am a newcomer to ExifTool and very impressed by its capabilities, but I am having a problem with the  C++ interface. 

  I am trying (and failing) to pass the  "-c %d %d %.4f"  to ImageInfo in C++.

  I am clearly getting something wrong.  I have tried quoting just the GPS format, quoting the whole command with and without escaped quotes on the format. 

  What am I missing or misunderstanding? 

 Thanks and Regards

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 19109
    • ExifTool Home Page
Re: cpp passing ImageInfo arguments
« Reply #1 on: February 08, 2021, 09:16:30 PM »
From the documentation (underline added):

   const char *opts
   Additional exiftool options, separated by newlines. See notes 2, 3 and 5.
   Only the following exiftool options are allowed:  -TAG -x -b -c -charset -d -L
   -lang -listItem -n -sep -sort --a -e -ee -ext -F -fast -fileOrder -i -if -m -password
   -r -scanForXMP -u -U -z -globalTimeShift -use -@ -api


So you should use "-c\n%d %d %.4f".

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

PaulWilliams

  • Newbie
  • *
  • Posts: 6
Re: cpp passing ImageInfo arguments
« Reply #2 on: February 08, 2021, 09:30:30 PM »
Phil,

   Thanks for the very prompt response. 

   I had read the line "Additional exiftool options" the documentation a number of times.  It had not once struck me to put a newline between
   the flag and its associated values. As soon as I read the same text in your reply (before seeing your example)  I wondered if it could mean a
   newline between the two. 

   Thanks again for the response and a tool that has transformed my knowledge of image metadata. 

Paul