zolotoiy
10-12-2006, 03:06 PM
I saw many people were asking here about including lens information in their blogs but that data was not available in stardard tags, so I digged in into Exifer code a bit and found that while that data is retrieved it is not correctly processed. Beware, this is my first take on PHP, so be kind :).
This requires modification of Exifer code - I'm not sure about procedures because original developer closed this project almost 2 years ago.
Problems were in unnecessary byte order convertion and too generic handling of data. LensInfo f.e. contains 4 rational numbers while only one was processed in original code.
So here it goes:
Replace your file /includes/exifer1_5/makers/nikon.php with this one (http://x-processed.ca/samplepics/nikon.rar).
Install ExtraExif addon, add following code to it:
$lens = $exif_result['SubIFD']['MakerNote']['LensInfo'];
if( isset( $lens ) && $lens != "" )
$lens .= " ".$exif_result['SubIFD']['MakerNote']['LensType'];
$tpl = str_replace("<EXIF_COMPAT_LENS>",$lens,$tpl);
if($lens != "")
{
$lens = "Lens: $lens";
$tpl = str_replace("<LANG_COMPAT_LENS>",$lens,$tpl);
}
That's it. My blog already has this code but beware that not all images will have lens info - Photoshop strips down all Nikon makernotes, so might other programs. Nikon Capture and ACDSee retain it.
This requires modification of Exifer code - I'm not sure about procedures because original developer closed this project almost 2 years ago.
Problems were in unnecessary byte order convertion and too generic handling of data. LensInfo f.e. contains 4 rational numbers while only one was processed in original code.
So here it goes:
Replace your file /includes/exifer1_5/makers/nikon.php with this one (http://x-processed.ca/samplepics/nikon.rar).
Install ExtraExif addon, add following code to it:
$lens = $exif_result['SubIFD']['MakerNote']['LensInfo'];
if( isset( $lens ) && $lens != "" )
$lens .= " ".$exif_result['SubIFD']['MakerNote']['LensType'];
$tpl = str_replace("<EXIF_COMPAT_LENS>",$lens,$tpl);
if($lens != "")
{
$lens = "Lens: $lens";
$tpl = str_replace("<LANG_COMPAT_LENS>",$lens,$tpl);
}
That's it. My blog already has this code but beware that not all images will have lens info - Photoshop strips down all Nikon makernotes, so might other programs. Nikon Capture and ACDSee retain it.