ExifTool Forum

ExifTool => Developers => Topic started by: PaulWilliams on February 08, 2021, 06:49:32 PM

Title: cpp passing ImageInfo arguments
Post by: PaulWilliams 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
Title: Re: cpp passing ImageInfo arguments
Post by: Phil Harvey on February 08, 2021, 09:16:30 PM
From the documentation (https://exiftool.org/cpp_exiftool/index.html#ImageInfo) (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
Title: Re: cpp passing ImageInfo arguments
Post by: PaulWilliams 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