Error while trying to replace Lens Type tag content

Started by adas, February 27, 2016, 03:14:58 PM

Previous topic - Next topic

adas

hi
I am very new to exiftool. just downloaded yesterday..

am able to update / replace contents of some Tags in a CR2 file, using exiftool using command line arguments.

however there are two tag called "Lens Type" and "Lens ID"which I am able to see their values (its under the Maker group.. in this case Maker is Canon) but I am unable to update it's value using the  -*TAG*=Value   syntax..

I am using a command essentially like
exiftool  -Canon:LensType="EF28 - 300 f/3.5-5.6L IS USM"  IMG_8714.CR2  -o New_8714.CR2

For LensType tag its giving Warning : Can't Convert Canon:LensType. Its not in (printconv) and the value remains unchanged in the output file.

In the case of  the Tag "LensID" it does not give any error or warning message but when I dump the Tags after running the command I see that the value is not the one that I tried to update. It says unkown.

It's rather essential for me to be able to replace/update the values of these two Tags .. hence I would be very grateful for any suggestions, hints, or solution on command usage on exiftools to be able to update.

thanks a lot for your time and the help.. truly appreciate it.

Phil Harvey

There are various Composite LensID tags.  To change them may be difficult because you must update all of the tags from which they are derived.  See the Composite tags documentation for a list of these.

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

StarGeek

An image I found on flickr had the Canon:LensType as Canon EF 28-300mm f/3.5-5.6L IS and Canon:LensModel as EF28-300mm f/3.5-5.6L IS USM
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

adas

Thanks Phil
Will try to tweak some of the derived from tags to see if I can make it change the composite LensID.. will update all on my findings.

StarGeek it appears the LensType Tags you mentioned is derived so it is something that cannot be directly updated.. I was trying to do that but it was not working..
I was able to update the LensModel tag and it is exactly same as what you have shared but still the LensType does not get computed as what you've notices.

In case you are aware of whichc derived from tags I need to change to reflect the change in the Lens Type it would help a lot.. but as I said I'll play around with trying to change derived from tags and see.. If I am indeed able to change after some experimentation I'll share on this thread.

thanks again and thanks Phil for the tool ... its quite handy and well written and documented :-)

StarGeek

Quote from: adas on February 27, 2016, 11:26:45 PM
StarGeek it appears the LensType Tags you mentioned is derived so it is something that cannot be directly updated.. I was trying to do that but it was not working..

Sorry, I was in a rush and wasn't explicit in pointing out the problem.  I was specifically talking about the Canon:Lenstype, which is a MakerNotes tag.   LensID is a composite tag and can't be directly changed.

Canon:LensType can be changed.  It just can't be changed to a random string.   You can find the list here.  Exiftool can take the name from the list and converts it to the signed 16 bit integer which is what the specs require.  That's why you get the printconv error.  The lens type you give it isn't on the list.  You can also directly save the number by using -canon:lenstype#=nn where nn is the number corresponding to the proper lens.

The LensType you wanted to set was "EF28 - 300 f/3.5-5.6L IS USM" but it isn't on the list.  Plus, it doesn't have "mm" in it and has a few extra spaces in places.  I was able to find a image on flickr that had a similar string to yours in the Canon:LensModel tag and the LensType it had set was Canon EF 28-300mm f/3.5-5.6L IS

So basically what I'm suggesting is that the command you probably want to use would have -Canon:LensType="Canon EF 28-300mm f/3.5-5.6L IS" -Canon:LensModel="EF28-300mm f/3.5-5.6L IS USM" in it.  I'm guessing that you want to be very accurate with what data you change LensModel to, as that tag is a string and ExifTool will happily change it to whatever you like.  Since LensModel is one of the tags LensID is derived from, if ExifTool doesn't understand what data is in the LensModel tag, you might get a faulty LensID.

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

adas

Hi StarGeek
Thanks a lot for the detailed explanation and correct command line argument value for updating LensType syntax..
I tried it and was able to update the LensType successfully.. you are right it is rather sensitive to spaces and it does not take USM but LensModel needs it :-)

Also was able to figure out a set of values of LensType that I would want to use from the page you shared with list of Canon Tags and their valid values

thanks a lot.. your prompt help is greatly appreciated and also able to understand the composite tag concept and it's dependencies as well as MakerNotes/Tags.