Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - cmuck

Pages: [1]
1

Can you try it to do that? here is photo from mi Nikon D200 camera.
http://www.myanimalsworld.com/out/

Sorry somehow your Nikon does not provide me any Lens informations in the Exif Data.

If one wants me to implement this, one should also sure that his camera provides the informations somewhere in the exifs. (I use the firefox addon "exif viewer" to take a look at the exifs.)

sorry

Kind reagrds
Carsten

2
Long time no see  :cry:

Because i do not get any Mails when users Post here i did not read your post.

Hopefully i can enegneer a solution over the weekend.

kind regards

3
Hello,

the Lens Informations are put into the metadata not in the common exif fields.

The Field i read out is aux:Lens.

If one can provide the field the Nikon Cameras places the Lens informations it can be easily changed in the code:
Quote
array("name" => "AUX lens", "regexp" => "/Lens=\".+\"/")

Replace aux:Lens against aux:Whatever and it should work.

Maybe you can provide me an Image taken with ohter vendors, so i can improve the code of reading the Lens information out of the metadata.

Kind regards
carsten


4
Hello,

i have developed a meothod to display the Lens informations of DSLR Cameras. It works on my Version 1.7.6 it has not been tested with oder versions.

The Lens informations are displayed for Canon DSLR Cameras, it has not been tested with other vendors.

Feel free to redistribute, change, or even better improve the code  :D

Here are the modifications which have to be done:

Insert into functions.php above the line
Code: [Select]
function get_iptc_info($info) {
this code:
Code: [Select]
function get_lens_info($filename) {

    ob_start();
    readfile($filename);
    $source = ob_get_contents();
    ob_end_clean();

    $xmpdata_start = strpos($source,"<x:xmpmeta");
    $xmpdata_end = strpos($source,"</x:xmpmeta>");
    $xmplenght = $xmpdata_end-$xmpdata_start;
    $xmpdata = substr($source,$xmpdata_start,$xmplenght+12);

    $xmp_parsed = array();

    $regexps = array(

    array("name" => "AUX lens", "regexp" => "/Lens=\".+\"/")
    );

    foreach ($regexps as $key => $k) {
            $name         = $k["name"];
            $regexp     = $k["regexp"];
            unset($r);
            preg_match ($regexp, $xmpdata, $r);
            $xmp_item = "";
            $xmp_item = @$r[0];
            array_push($xmp_parsed,array("item" => $name, "value" =>
$xmp_item));
    }

    foreach ($xmp_parsed as $key => $k) {
                $item         = $k["item"];
                $value         = $k["value"];
                $myvalue = explode("\"", $value);
/*                print $myvalue[1];*/
    }
return $myvalue[1];

}

Some lines below in functions.php insert after:
Code: [Select]
$height = "";
$iptc_info = "";
$exif_info = "";

this code:
Code: [Select]
$lens_info = "";

Above the line:
Code: [Select]
$exif_array = get_exif_info($exif_data);

this code:
Code: [Select]
$lens_info = get_lens_info($src);

finally insert after:
Code: [Select]
"height" => $height,
"iptc_info" => $iptc_info,
"exif_info" => $exif_info,

this code:
Code: [Select]
"lens_info" => $lens_info
Be aware that you need to insert a "," right behind the "$exif_info" as printed above

in details.html insert behind the line
Code: [Select]
{exif_info}

this code:
Code: [Select]
{if lens_info}
<table width="100%" border="0" cellspacing="0" cellpadding="1">
                 <tr>
                  <td class="bordercolor">
                    <table width="100%" border="0" cellpadding="3" cellspacing="0">
                       <tr>
<td class="head1" valign="top" colspan="2">Objektivdaten (sofern vorhanden)</td>
                       </tr>
<td valign="top" class="row1" width="50%"><b>Objektiv:</b></td>
<td valign="top" class="row1">{lens_info}</td>
                       </table>
                    </td>
                   </tr>
                 </table>
{endif lens_info}

You can see the result here:

http://kleinermuck.myphotos.cc/details.php?image_id=45

The code to read the metadata has been found on google. The code has been written by Pekka Saarinen http://photography-on-the.net. The code has been slightly changed by me to fit our requirements.

kind regards
carsten

Pages: [1]