Home

Please support mflenses.com if you need any graphic related work order it from us, click on above banner to order!

SearchSearch MemberlistMemberlist RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

Exiftool for MF lenses
View previous topic :: View next topic  


PostPosted: Sat Feb 18, 2012 3:45 pm    Post subject: Exiftool for MF lenses Reply with quote

The following is written with Lightroom in mind... Perhaps it is important to know that I have written these small "scripts" for use with NEX.

I would like to write basic lens information to the EXIF for use in Lightroom. If I use an Industar-26m, I want to put that in the EXIF. Problem is, I may have several copies of the same lens, so I'll want to write something like a serial number as well. And while we're at it, I want to put the used f-value as well. I use the following cmd line for exiftool:

exiftool -@ ARGFILE RAWDIR

ARGFILE is named for the particular lens that I used:
czjtessar50exa.txt: Carl Zeiss Jena Tessar 50mm f/3.5 (EXA)
jupiter9LTM.txt: Jupiter 9 8.5cm f/2 (M39)
nikon50f18.txt: Nikon 50mm f/1.8
yashica28.txt: Yashica ML 28mm f/2.8
etc....

RAWDIR is the directory that contains the RAW-files I want to change. So the command line may become something like this:

exiftool -@ czjtessar50exa.txt H:\RAW\2012\20120218.Family.NEX\

Now let's take a look at the content of czjtessar50exa.txt:

Quote:

-n
-XMP:Lens=Carl Zeiss Jena Tessar 50mm f/3.5 (EXA)
-XMP:SerialNumber=3692001
-EXIF:MaxApertureValue=3.5
-EXIF:FocalLength=50
-EXIF:FocalLengthIn35mmFormat=50
-EXIF:FNumber=5.6


Note that it will write the f-value to all RAW-files, so it's useful if all pictures are made at the same aperture setting. If this is not the case, drop the line, or write scripts per used f-value and divide your images over different directories. It's not difficult but becomes "laborious". You'd also have to remember all used settings or - like in the old days - write them down Smile

Now let's take a look at the content of yashica28.txt:

Quote:

-n
-XMP:Lens=Yashica ML 28mm f/2.8
-XMP:SerialNumber=A12019868
-EXIF:MaxApertureValue=2.8
-EXIF:FocalLength=28
-EXIF:FocalLengthIn35mmFormat=28
-EXIF:FNumber=4


All photos made were at f/4.

Now a last one especially for those hung up on ruski optics and the Π-symbol:

Quote:

-n
-ex
-XMP:Lens=Jupiter-9 8,5cm f/2 &#928 ; (M39)
-XMP:SerialNumber=5800237 &#928 ;
-EXIF:MaxApertureValue=2
-EXIF:FocalLength=85
-EXIF:FocalLengthIn35mmFormat=85
-EXIF:FNumber=2


You have to remove the space between &#928 and ; to make it work.
And if it works like on my computer, all these date should show up in LR. It's now easy to search in the archives for all photos made by a certain lens.

Hope it was useful.


PostPosted: Sat Feb 18, 2012 5:26 pm    Post subject: Reply with quote

Great hint! Many thanks!


PostPosted: Thu Mar 01, 2012 8:49 am    Post subject: Reply with quote

Hi,

Does anyone could explain how to get the EXIF ​​data of the target in Lightroom or Photoshop? I would like to do but I am in capable.

Thank you.


PostPosted: Thu Mar 01, 2012 10:30 am    Post subject: Reply with quote

dani9batan wrote:
Hi,

Does anyone could explain how to get the EXIF ​​data of the target in Lightroom or Photoshop? I would like to do but I am in capable.

Thank you.


Tal vez le ayude este link para encontrar los datos EXIF en LR.

Perhaps this link (en español) will help you.


PostPosted: Thu Mar 01, 2012 11:00 am    Post subject: Reply with quote

fotomachi wrote:
dani9batan wrote:
Hi,

Does anyone could explain how to get the EXIF ​​data of the target in Lightroom or Photoshop? I would like to do but I am in capable.

Thank you.


Tal vez le ayude este link para encontrar los datos EXIF en LR.

Perhaps this link (en español) will help you.


Thanks! but I would want to change this EXIF data; change de name of the lens and the aperture of diaphragm.

Gracias por el español Laughing


PostPosted: Thu Mar 01, 2012 12:25 pm    Post subject: Reply with quote

You need to have exiftool installed. You can get this program here: http://www.sno.phy.queensu.ca/~phil/exiftool/
Then you write a file that includes all the data you want to change, also known as ARG-file. I make individual text files for every lens that I have. For instance yashica28.txt

Code:
-n
-XMP:Lens=Yashica ML 28mm f/2.8
-XMP:SerialNumber=A12019868
-EXIF:MaxApertureValue=2.8
-EXIF:FocalLength=28
-EXIF:FocalLengthIn35mmFormat=28
-EXIF:FNumber=4


FNumber is the only "variable". I usually always use the same f-value during a certain time or write down the used settings in a small notebook I always carry with me. All the ARG-files I have are stored in the same directory as the exiftool executable.
In windows, I add the following in the command line:

exiftool -@ ARGFILE RAWDIR

Where ARGFILE is the name of the ARG-file and RAWDIR is the directory that contains all the RAW-files I want to change. I change the RAW-files, but you off course do the same for jpegs or whatever.

In the command line of windows, I will give the following command (for example):

exiftool -@ yashica28.txt H:\RAW\2012FEB12\

And it will change all the files within that directory. You may want to change only one file:

exiftool -@ yashica28.txt H:\RAW\2012FEB12\DSC_7890.NEF

That is really all there is to it Smile


PostPosted: Thu Mar 01, 2012 1:37 pm    Post subject: Reply with quote

This is for Windows? I work on MAC Crying or Very sad Crying or Very sad

Thank you very much for your help fotomachi.


PostPosted: Thu Mar 01, 2012 3:11 pm    Post subject: Reply with quote

dani9batan wrote:
This is for Windows? I work on MAC Crying or Very sad Crying or Very sad

Thank you very much for your help fotomachi.


On the website (http://www.sno.phy.queensu.ca/~phil/exiftool/) there is also an executable for MAC... Don't know how to do it for MAC though... Confused


PostPosted: Thu Mar 01, 2012 3:42 pm    Post subject: Reply with quote

Very nice trick.
Thanks for sharing.


PostPosted: Thu Mar 01, 2012 3:51 pm    Post subject: Reply with quote

I am unable to get that, someone knows how to do it on Mac?


PostPosted: Sat Mar 03, 2012 9:52 am    Post subject: Reply with quote

dani9batan wrote:
I am unable to get that, someone knows how to do it on Mac?

Hello, did you check this out: http://www.sno.phy.queensu.ca/~phil/exiftool/install.html?
The instructions seem detailed enough, more than this I can't tell since I'm no mac user.
Make sure you have "perl" installed.

Cheers, M.


PostPosted: Sun Mar 04, 2012 9:09 am    Post subject: Reply with quote

Thanks Marty, I'm going to try it Wink


PostPosted: Sun Mar 04, 2012 10:36 am    Post subject: Reply with quote

I got it! Thanks to everyone! Very Happy Very Happy Very Happy Very Happy Very Happy

http://img833.imageshack.us/img833/5448/capturadepantalla201203z.jpg


PostPosted: Tue Mar 06, 2012 7:05 pm    Post subject: Reply with quote

Thanks photomachi for this informative post. I had been thinking about how I would go about adding lens information to my images.

However, the workflow that I ended up with looks a bit different from yours, mostly because I prefer to add the EXIF data once the images are imported. It is sometimes helpful to be able to look at the pictures in the grid view and select the ones you want to update.

I claim no originality in this, but I thought it would be helpful to others.

1. In the OSX Terminal application, either type the exiftool command line from memory or copy it from a text file, for example like this:
Code:
exiftool -LensModel="Fujian 35mm f/1.7 CCTV" -FocalLength=35 -MaxApertureValue=1.7 -m -overwrite_original_in_place -P

...Do not hit enter at this time. And whatever current directory you're in doesn't matter - the default (home directory) is fine.

2. In Lightroom's Library grid view, select the images you want to update.

3. Drag and drop the selected images onto the Terminal app. This will add the complete file names to the command line (recent versions of Windows cmd.exe should behave the same). Now hit enter to have exiftool work its magic on your files.

4. When done, go back to Lightroom, select Read metadata from files from the Metadata menu.

That's pretty much it. Lightroom should display your added EXIF data.

Also, it appears that my NEX-5N writes EXIF somewhat different other cameras I have used. I have to use "LensModel" instead of "Lens" in order for Lightroom to properly pick up and display the lens for some reason. Or it could just be that I'm now using Lightroom version 4, but I doubt it.


PostPosted: Wed Mar 07, 2012 7:42 am    Post subject: Reply with quote

Quote:
Also, it appears that my NEX-5N writes EXIF somewhat different other cameras I have used. I have to use "LensModel" instead of "Lens" in order for Lightroom to properly pick up and display the lens for some reason. Or it could just be that I'm now using Lightroom version 4, but I doubt it.


That may well be possible... I wrote these small ARG-files for a NEX-5 and a D700 and they work for those two cameras. There are often minor differences in EXIF between the camera models. For instance,

Code:
-XMP:SerialNumber=A12019868


is displayed properly for all lenses when the NEX-5 was used, but in case of the D700, the serial number of my D700 camera is displayed. However, SerialNumber is written to the file and there is no interference between the lens and the camera serial number.


PostPosted: Sun Mar 18, 2012 8:05 pm    Post subject: Reply with quote

I've updated to LR4 and guess what... it doesn't work anymore Confused

After doing some reading, I changed the following parameter:

Code:

-XMP:Lens=Nikon S.C Auto 50mm f/1.4 pre-Ai


to the following:

Code:

-EXIF:LensModel=Nikon S.C Auto 50mm f/1.4 pre-Ai


And it works again (at least for Sony NEX-5 and LR4).


PostPosted: Sun Mar 18, 2012 8:10 pm    Post subject: Reply with quote

Good job I'm a patient man. Page two of this thread so far, and still none of it makes any sense to me Laughing


PostPosted: Mon Mar 19, 2012 10:37 am    Post subject: Reply with quote

GrahamNR17 wrote:
Good job I'm a patient man. Page two of this thread so far, and still none of it makes any sense to me Laughing


Very Happy Confused

Is it because it's not explained well enough? If that is the case, input to make it easier to do/understand is welcome off course.


PostPosted: Mon Mar 19, 2012 11:08 am    Post subject: Reply with quote

I think that just adding tags with the name of the lens used in LR is kind of faster and easier to do. Those tags are also saved to Exif when you export from LR.

Exiftool is a command line tool and it's not so easy to manipulate from LR for individual photos.


PostPosted: Thu Mar 22, 2012 2:51 pm    Post subject: Reply with quote

I did roughly the same thing a couple of years ago, thinking about processing a whole card's worth of images at a time.

The result is in https://github.com/zandr/LensTag. You give it a config file for the lens, optionally a GPS log, and a list of files (usually * in a directory) and it adds the tags.

I've recently dusted this off because of a brilliant suggestion. I've condensed the config files to the point where they'll fit in a QR code. Now, when I'm in the field shooting and switch lenses, I snap a pic of the QR code for that lens and go on my way.

I'm now working on the code to scan a directory of pictures looking for QR codes. It's a little bit tricky: I need to be sure I'm processing them in order by EXIF date, since file numbers can wrap around.

I also use an external GPS logger, so I'm working on a solution for synchronizing camera clocks as well. There are in fact iPhone and Android apps that show a QR code clock. Very Happy


PostPosted: Thu Mar 22, 2012 3:05 pm    Post subject: Reply with quote

GrahamNR17 wrote:
Good job I'm a patient man. Page two of this thread so far, and still none of it makes any sense to me Laughing


+1
Sigh - how quickly one gets left behind in this modern fast-moving technological world! Crying or Very sad


PostPosted: Thu Mar 22, 2012 3:25 pm    Post subject: Reply with quote

n6mod wrote:
I did roughly the same thing a couple of years ago, thinking about processing a whole card's worth of images at a time.

The result is in https://github.com/zandr/LensTag. You give it a config file for the lens, optionally a GPS log, and a list of files (usually * in a directory) and it adds the tags.

I've recently dusted this off because of a brilliant suggestion. I've condensed the config files to the point where they'll fit in a QR code. Now, when I'm in the field shooting and switch lenses, I snap a pic of the QR code for that lens and go on my way.

I'm now working on the code to scan a directory of pictures looking for QR codes. It's a little bit tricky: I need to be sure I'm processing them in order by EXIF date, since file numbers can wrap around.

I also use an external GPS logger, so I'm working on a solution for synchronizing camera clocks as well. There are in fact iPhone and Android apps that show a QR code clock. Very Happy



That actually is a brilliant suggestion.. ! Very Happy
It's something I'm going to dig out a bit deeper as well Very Happy


PostPosted: Thu Mar 22, 2012 3:32 pm    Post subject: Reply with quote

peterqd wrote:
GrahamNR17 wrote:
Good job I'm a patient man. Page two of this thread so far, and still none of it makes any sense to me Laughing


+1
Sigh - how quickly one gets left behind in this modern fast-moving technological world! Crying or Very sad


Important things to understand in life:








Not-so-important things:



I'd say everything is allright Laughing


PostPosted: Thu Mar 22, 2012 5:51 pm    Post subject: Reply with quote

You cheered me up Orio! Everything is still all right with the world. Smile

I like your style too, food above women. But where's the beer? Embarassed


PostPosted: Thu Mar 22, 2012 6:04 pm    Post subject: Reply with quote

peterqd wrote:
You cheered me up Orio! Everything is still all right with the world. Smile

+1 Cool

I shall, from this day forward, live my life by Orio's teachings Very Happy Laughing