The AlphaLensInfo program takes Sony/Minolta raw and jpeg images (for both A- and E-mount) and adds a lens desciption that can be read by programs like Lightroom. Now you can finally see what lens you used to take a particular photo.
If you are also interested in flexible photo importing you may want to look at the ImportPhotos program (which includes the AlphaLensInfo functionality)
Version 2.4
This is a command line program that needs to be called from a command prompt. It simply takes the images to be updated as the argument. For example:
> alphalensinfo -v *.jpg update DSC03620.JPG lens: Zeiss Vario-Sonnar T* 24-70mm F2.8 ZA SSM update DSC03621.JPG lens: Minolta AF 400mm F4.5 HS-APO G, Sony AF 1.4x APO (D)
In the above case, both the jpeg files are updated with their lens description (the lovely Zeiss 24-70mm lens and the Minolta 400G with a Sony teleconverter). The -v verbose flag is given in order to print the found lens description. For a first time, I recommend running with the -d flag too which just does a dry run and never writes to any file.
With jpeg files, the lens description is stored in the jpeg file itself. With raw files (.arw or .mrw), the program writes an .xmp file that is automatically read by Lightroom and certain other programs. When there is already a .xmp file the program merges in the lens description. If a lens description is already present, nothing is done by default (unless the -t flag is specified).
By default, the program always writes a backup file when updating a jpeg or xmp file. This is extra safe, but once you trust the program, you may want to give the -o overwrite flag that updates these files inplace. You can also run with the flag -d to do a dry run where no files are written to at all.
The download comes with the default lens table lenses.txt. Unfortunately, the lens identifiers are not always unique and especially third party lenses often (re)use an existing identifier from a Sony/Minolta lens. The program tries it best to disambiguate by taking the focal length, aperture, use of a teleconverter, and whether this is an APS-C lens into account.
If the program still misidentifies a particular lens you are using, or you need to add a new lens, you can either add an entry to a file mylenses.txt or update the lenses.txt file to give preference to your particular lens. See the lenses.txt file for specific instructions.
The command line options are:
usage:
alphalensinfo [options] file1 .. fileN
options:
-?, -h --help show this information
-o --overwrite make no backup and overwrite files in-place
-t --overwrite-tag always write lens information (even if present)
--lenses=<file> use the specified lens table
-d --dryrun dry run: do not update any files
-v --verbose print lens information
-s --showsss show whether SteadyShot was used
-r --recursive visit subdirectories recursively
-c --comment also write lens info to comment section in jpeg's
-l <num> --lens=<num> assume the given lens id is used to make the photo
Also, default command line options are read from the environment variable ALPHALENSINFO. For example, on my machine I have set this variable to "--showsss --overwrite --verbose". See here for information on how to set an environment variable on Windows.
The -s flag optionally adds to the lens information (SSS) when image stabilization was enabled when capturing the image.
The recursive flag -r visits all subdirectories too. When using this flag, it is usually necessary to put single quotes around the pattern, for example: alphalensinfo -v -r 'photos\*.jpg'
The --lenses flag lets you specify the location of the lenses.txt file that maps the Sony/Minolta lens numbers to their description. For example: alphalensinfo --lenses="c:\My Documents\lenses.txt". By default, the program looks for this file in the application directory and user home directory, and if it cannot be found uses a builtin table. Also, in the same directory it looks for the file mylenses.txt and gives preference to any lens entries it finds there.
The --comment flag not only writes the lens information to an XMP section in a jpeg file, but also to the standard comment section. If comments are already present, the lens information is simply appended. This option is there if the program you use does not read XMP information but can handle comment sections in jpeg files (like the FastStoneBrowser)
Finally, the --lens flag lets you specify a fixed lens identifier that is used to create the lens description. For example, to pretend to have taken the picture with a Zeiss Planar 85mm, one could use --lens=45 (see the lenses.txt file for all identifiers). When using this option, there is no disambiguation and always the first lens present with the specified id is used.
If you would like to add lens information to existing files in Lightroom, you first need to save all the modifications that were made in Lightroom as metadata. To do that: go to a specific folder, select all the photos, right click and select metadata > save metadata to files. Now, you can run the αLensInfo tool to update those photos. The program will automatically merge the lens description with the metadata written by Lightroom. Once this is done, you can go back to Lightroom, select all photos, right-click, and select metadata > read metadata from files.
When updating such a large amount of photos, it can make sense to first do a dryrun and look through the list of photos to see if all lenses are correctly identified. If not, you may want to edit the supplied lenses.txt file before doing the updating. For example:
> alphalensinfo -v -d -r '*.arw' > output.txt
This command does a dry run of the program with verbose output, recursively descending directories, and writing the output to the file output.txt such that you can browse it conveniently after the command is done.
The program has been tested on raw and jpeg files from Canon, Nikon, Sony, and Minolta. It can update lens information on the (Konica) Minolta 5D and (Konica) Minolta 7D raw and jpeg files (.mrw and .jpg), and all the Sony Alpha raw and jpeg files (.arw and .jpg) (tested on the α100, α200, α350, α700, and α900).
The AlphaLensInfo program is written in Haskell and requires a Haskell compiler to build.
> darcs get http://www.equational.org/repos/importphotos.AlphaLensInfo and ImportPhotos is free software; you can redistribute it and/or modify it under the terms of the modified BSD license.
THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE LICENSE FOR MORE DETAILS.
29 Feb 2009