ExifTool Forum

ExifTool => ExifTool GUI => Topic started by: MalcR on September 30, 2011, 03:09:00 PM

Title: EXIFtool Direct feature truncating some commands
Post by: MalcR on September 30, 2011, 03:09:00 PM
I've been using the EXIFtool Direct feature and noticed that it removes quotes from the beginning and end of the command line. Example:

"-LensModel=Samyang 14mm F2.8" "-LensInfo=14mm f/2.8" "-FocalLength=14mm" -if "not $lensmodel"

I know I could move the leading quotes to after the = sign but the closing quote is necessary. When I enter this line as a predefined command then close and open the program, the predefined command does not have the opening and closing quotes. I haven't checked for the loss of any other characters.
Title: Re: EXIFtool Direct feature truncating some commands
Post by: BogdanH on September 30, 2011, 03:59:04 PM
Hi,

Weird... as it seems, if first and last character is quote, then both quotes aren't read from ini file. Will checkout tomorrow.
Thanks for posting.

Bogdan
Title: Re: EXIFtool Direct feature truncating some commands
Post by: BogdanH on October 01, 2011, 08:10:15 AM
Mistery solved, but...
It is how MS Windows reads ini files. Here http://msdn.microsoft.com/en-us/library/ms724366.aspx -we can read:
Remarks
If the string associated with the lpKeyName parameter is enclosed in single or double quotation marks, the marks are discarded when the GetProfileString function returns the string.


I believe, chances that commands needs to be started and ended with quotes, are quite rare. Using above example:
"-LensModel=Samyang 14mm F2.8" "-LensInfo=14mm f/2.8" "-FocalLength=14mm" -if "not $lensmodel"
..should be written as:
-LensModel="Samyang 14mm F2.8" -LensInfo="14mm f/2.8" -FocalLength="14mm" -if "not $lensmodel"
..which is how parameters are expected to be passed.

Anyway, it was an interesting finding.

Bogdan