ExifTool Forum

ExifTool => Newbies => Topic started by: lokatz on June 04, 2020, 04:42:11 PM

Title: Basic issue: creating JpgFromRAW via -o option
Post by: lokatz on June 04, 2020, 04:42:11 PM
I am using Exiftool successfully as an external resource in a C# program to read metadata and convert certain image formats.  However, for speed reasons, I would like to use the -StayOpen option, where I am running into a basic issue where I seem to have a misunderstanding  of how Exiftool works.

So far, I've been using a command like this one:

"C:\ExiftoolDir\exiftool.exe" -b -JpgFromRaw "C:\Temp\Bird.NEF" > "C:\ProgramData\MyImages\Bird.jpg"

to call Exiftool as an external process under Windows 10.  The '>' is a shell command telling windows to take the Exiftool output and write it as a JPG file.  Works great.  (The quotation marks are required since all paths could include blanks.) 

However, in order to use the -StayOpen option, I can no longer use this shell command since everything now needs to be run through an ArgFile.  From reading the Exiftool documentation, I got the impression that calling

"C:\ExiftoolDir\exiftool.exe" -b -JpgFromRaw "C:\Temp\Bird.NEF" -o "C:\ProgramData\MyImages\Bird.jpg"

would achieve the same thing - but it doesn't:  the Process exits unsuccessfully when changing my code to this. 

What am I missing?  Am I misinterpreting the -o command here, or do I need to look for an error in the logic of how the process gets executed in my program?  Will appreciate any hints you can give me.  Thanks.
Title: Re: Basic issue: creating JpgFromRAW via -o option
Post by: StarGeek on June 04, 2020, 05:57:07 PM
The -o (Outfile) option (https://exiftool.org/exiftool_pod.html#o-OUTFILE-or-FMT--out) writes changes made to a file to a different directory.  Basically used to copy/move a file while making edits.

In order to extract data and write it out, you want to use the -w (textout) option (https://exiftool.org/exiftool_pod.html#w-EXT-or-FMT--textOut).  See this post (https://exiftool.org/forum/index.php?topic=3310.msg14902#msg14902).
Title: Re: Basic issue: creating JpgFromRAW via -o option
Post by: lokatz on June 05, 2020, 03:33:53 AM
This is very helpful.  Thank you!