Author Topic: .NET "wrapper" dll  (Read 36618 times)

VeryKross

  • Newbie
  • *
  • Posts: 4
Re: .NET "wrapper" dll
« Reply #30 on: June 10, 2019, 08:29:25 PM »
Thanks Phil - I'll play around with those options; hopefully the .Net wrapper will respect them :)

obetz

  • Sr. Member
  • ****
  • Posts: 161
Re: .NET "wrapper" dll
« Reply #31 on: June 11, 2019, 09:05:10 AM »
a quick look at the source code raised some questions, e.g.

Why does it use "exiftool(-k).exe"? As it is used with -stay_open, -k makes no sense IMO.

What happens if somebody passes a command dealing with more than one file? The return string is checked against "1 image files updated".

VeryKross

  • Newbie
  • *
  • Posts: 4
Re: .NET "wrapper" dll
« Reply #32 on: June 23, 2019, 12:49:10 AM »
Hi Phil,

I wanted to loop back on this as it's proving to be a bit more troublesome to get this working with the C# wrapper than I first thought. I was wondering if there was any option in ExifTool to override the default newline conversion; instead of converting to periods, convert to a character(s) that are specified in the option (thinking along the lines of the -sep option).  This would allow me to specify an "unlikely" character, e.g. ~, that could be easily identified in the output string and converted back. Of course, that doesn't address saving multi-line text back to the metadata field, unless of course by specifying the same option while writing that you'd convert back to the proper newline character(s).

Thoughts?

Ken

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 15115
    • ExifTool Home Page
Re: .NET "wrapper" dll
« Reply #33 on: June 25, 2019, 08:20:00 AM »
Hi Ken,

Did you see FAQ 21?  There are many different alternatives for dealing with newlines.  I try to avoid adding new options unless absolutely necessary.

BTW, it isn't just newlines that are converted to ".".

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

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2749
Re: .NET "wrapper" dll
« Reply #34 on: June 25, 2019, 12:35:42 PM »
I was wondering if there was any option in ExifTool to override the default newline conversion; instead of converting to periods, convert to a character(s) that are specified in the option (thinking along the lines of the -sep option).

I didn't read the whole thread, so I might be missing the point…

Take a look at adding the RepNL helper function to your .exiftool_config file.  You can then add -api "Filter=RepNL($_)" to the command and all New Lines, Carriage Returns, and Tabs will be escaped to \n, \r, and \t.  You can edit it to change to some other character sequence if you like.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 15115
    • ExifTool Home Page
Re: .NET "wrapper" dll
« Reply #35 on: June 25, 2019, 12:45:44 PM »
@StarGeek: Very smart.  I'll add the API Filter option technique to FAQ 21.

- Phil

Edit:  FAQ updated.
« Last Edit: June 25, 2019, 12:56:29 PM by Phil Harvey »
...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 ($).