View Full Version : EXIF focal length 35mm equiv.
mightymightymax
06-03-2005, 02:17 AM
On my photoblog I have the EXIF from my Minolta DiMAGE 7Hi to display the focal length of the camera, but since its not a DSLR it comes up in fairly irrelevant numbers down to the 100,000,000 of a mm "Focal Length: 50.69140625 mm":roll: . Is there any way that I can either change this to regular 35mm equiv, or at least have something that says the 35 equiv? Since my camera has a 2/3" CCD the multiplication factor is 3.93. . .if that helps at all.
Thanks!
Max
P.S. any ideas on when pixelpost.org will be back up?
blinking8s
06-03-2005, 02:28 AM
Olympus C2040Z, Olympus C960 listed for exifer as being officially compatable with i think. Im not sure how the advanced point and shoot models handle exif, Im sure there is a way to knock it down so decimals dont not appear though.
We'll look into it...
with dslr's say my lens is 85mm and the sensor is 1.6 so im really getting 136...you want it to say you are really at 136? Exif records the lenses length, not the true optical length of the lens in proportion to the sensor.
mightymightymax
06-03-2005, 04:44 PM
I don't mind if it leaves the true focal length (ei, 50.69140625 mm or w/e) but I just want something to say the 35mm equiv. as well.
XerXes
06-05-2005, 12:05 PM
A short while ago I made an addon which does exactly this.
You can download it here: http://xerxes.dk/35mm.zip
Unzip it in your addons-directory and you can then add the tag <EXIF_FOCAL_LENGTH_35MM> in your template. Be sure to set the correct $focal_multiplier in the top of the 35mm.php-file.
Hope this helps.
mightymightymax
06-06-2005, 05:51 AM
A short while ago I made an addon which does exactly this.
You can download it here: http://xerxes.dk/35mm.zip
Unzip it in your addons-directory and you can then add the tag <EXIF_FOCAL_LENGTH_35MM> in your template. Be sure to set the correct $focal_multiplier in the top of the 35mm.php-file.
Hope this helps.
I unzipped it and put it in the addons, and uploaded that, then I changed the EXIF in the template and it just came up blank on the blog (the 35mm equiv.). What did I do wrong? :?
blinking8s
06-06-2005, 07:52 AM
did you do this?
$addon_description = "This addon enables the tag &lt;EXIF_FOCAL_LENGTH_35MM&gt;, which shows the focal length as is would be, if the image were taken with a 35mm film camera. In order for this to work, you must specify the focal length mulitplier in the top of the file 35mm.php in your addon directory.";
also, if using photoshop, make sure you 'file --> save as' to preserve your exif data...
XerXes
06-06-2005, 07:55 AM
Did you alter the multiplier in the file? That may obviously affect the output.
Also, make sure, that there is actually EXIF-data of the "original" focal-length on your test-image.
The addon works fine for me, here: http://fotoblog.xerxes.dk (look below the piictures and description), but of course that doesn't help you much.
My 35mm.php file looks like this:
<?php
$focal_multiplier = 3.94366197; // Use this to configure the multiplier used to convert to 35 mm equivalent scale.
// Get Current Image.
if($_GET['showimage'] == "") {
$row = sql_array("select image from ".$pixelpost_db_prefix."pixelpost where datetime<='$cdate' order by datetime DESC limit 0,1");
} else {
$row = sql_array("select * from ".$pixelpost_db_prefix."pixelpost where (id='".$_GET['showimage']."') AND datetime<='$cdate'");
}
if(isset($row['image'])) {
$image_name = $row['image'];
$curr_image = "images/$image_name";
$exif_result = read_exif_data_raw($curr_image,"0");
$focal = $exif_result['SubIFD']['FocalLength']; // Focal length
$focal35 = round($focal*$focal_multiplier,0);
$focal35 .= "mm";
if($focal != "") {
$tpl = str_replace("<EXIF_FOCAL_LENGTH_35MM>",$focal35,$tpl);
}
}
$addon_name = "35mm equivalent focal-info";
$addon_description = "This addon enables the tag &lt;EXIF_FOCAL_LENGTH_35MM&gt;, which shows the focal length as is would be, if the image were taken with a 35mm film camera. In order for this to work, you must specify the focal length mulitplier in the top of the file 35mm.php in your addon directory.";
$addon_version = "0.1";
?>
and my template (the part of it with EXIF-data) looks like this (in danish, but you get the point I hope):
<p>
<strong>EXIF-informationer:</strong>
<ul>
<li>Kamera: Olympus <EXIF_CAMERA_MODEL></li>
<li>Lukkertid: <EXIF_EXPOSURE_TIME></li>
<li>Bl&aelig;nde: <EXIF_APERTURE></li>
<li>Br&aelig;ndvidde: <EXIF_FOCAL_LENGTH> (<EXIF_FOCAL_LENGTH_35MM> @ 35 mm)</li>
<li><EXIF_FLASH></li>
<li>ISO: <EXIF_ISO></li>
</ul>
</p>
flashpunk
06-06-2005, 12:21 PM
Hey,
I just installed your plugin, and its working great. Thanks!
XerXes
06-06-2005, 12:41 PM
You're welcome :-)
I'm glad it's useful.
mightymightymax
06-06-2005, 05:38 PM
Did you alter the multiplier in the file? That may obviously affect the output.
Also, make sure, that there is actually EXIF-data of the "original" focal-length on your test-image.
The addon works fine for me, here: http://fotoblog.xerxes.dk (look below the piictures and description), but of course that doesn't help you much.
My 35mm.php file looks like this:
<?php
$focal_multiplier = 3.94366197; // Use this to configure the multiplier used to convert to 35 mm equivalent scale.
// Get Current Image.
if($_GET['showimage'] == "") {
$row = sql_array("select image from ".$pixelpost_db_prefix."pixelpost where datetime<='$cdate' order by datetime DESC limit 0,1");
} else {
$row = sql_array("select * from ".$pixelpost_db_prefix."pixelpost where (id='".$_GET['showimage']."') AND datetime<='$cdate'");
}
if(isset($row['image'])) {
$image_name = $row['image'];
$curr_image = "images/$image_name";
$exif_result = read_exif_data_raw($curr_image,"0");
$focal = $exif_result['SubIFD']['FocalLength']; // Focal length
$focal35 = round($focal*$focal_multiplier,0);
$focal35 .= "mm";
if($focal != "") {
$tpl = str_replace("<EXIF_FOCAL_LENGTH_35MM>",$focal35,$tpl);
}
}
$addon_name = "35mm equivalent focal-info";
$addon_description = "This addon enables the tag &lt;EXIF_FOCAL_LENGTH_35MM&gt;, which shows the focal length as is would be, if the image were taken with a 35mm film camera. In order for this to work, you must specify the focal length mulitplier in the top of the file 35mm.php in your addon directory.";
$addon_version = "0.1";
?>
and my template (the part of it with EXIF-data) looks like this (in danish, but you get the point I hope):
<p>
<strong>EXIF-informationer:</strong>
<ul>
<li>Kamera: Olympus <EXIF_CAMERA_MODEL></li>
<li>Lukkertid: <EXIF_EXPOSURE_TIME></li>
<li>Bl&aelig;nde: <EXIF_APERTURE></li>
<li>Br&aelig;ndvidde: <EXIF_FOCAL_LENGTH> (<EXIF_FOCAL_LENGTH_35MM> @ 35 mm)</li>
<li><EXIF_FLASH></li>
<li>ISO: <EXIF_ISO></li>
</ul>
</p>
This is what I have the 35mm set to. . .I didn't change the multiplier as I wasn't sure of the exact number for my camera, and because 3.94366197 seemed just about right.
<?php
$focal_multiplier = 3.94366197; // Use this to configure the multiplier used to convert to 35 mm equivalent scale.
// Get Current Image.
if($_GET['showimage'] == "") {
$row = sql_array("select image from ".$pixelpost_db_prefix."pixelpost where datetime<='$cdate' order by datetime DESC limit 0,1");
} else {
$row = sql_array("select * from ".$pixelpost_db_prefix."pixelpost where (id='".$_GET['showimage']."') AND datetime<='$cdate'");
}
if(isset($row['image'])) {
$image_name = $row['image'];
$curr_image = "images/$image_name";
$exif_result = read_exif_data_raw($curr_image,"0");
$focal = $exif_result['SubIFD']['FocalLength']; // exposure time
$focal35 = round($focal*$focal_multiplier,0);
$focal35 .= "mm";
if($focal != "") {
$tpl = str_replace("<EXIF_FOCAL_LENGTH_35MM>",$focal35,$tpl);
}
}
$addon_name = "35mm equivalent focal-info";
$addon_description = "This addon enables the tag &lt;EXIF_FOCAL_LENGTH_35MM&gt;, which shows the focal length as is would be, if the image were taken with a 35mm film camera. In order for this to work, you must specify the focal length mulitplier in the top of the file 35mm.php in your addon directory.";
$addon_version = "0.1";
?>
This is what the EXIF in my template is:
<IMAGE_NOTES><br /><strong><IMAGE_CATEGORY></strong> <br />
Camera model: <EXIF_CAMERA_MODEL> <br />Shutter speed: <EXIF_EXPOSURE_TIME> <br />Aperture: <EXIF_APERTURE> <br />Focal Length: <EXIF_FOCAL_LENGTH> <br />(35mm equiv. <EXIF_FOCAL_LENGTH_35MM> ) <br />ISO: <EXIF_ISO>
</div>
and then this is what it shows up as on my blog:
Camera model: DiMAGE 7Hi
Shutter speed: 1/125 sec
Aperture: f 3.5
Focal Length: 50.69140625 mm
(35mm equiv. )
ISO: 100
As you can see. . .its just blank.
Sorry for my lack of knowledge in this. . .this is my first photoblog with pixelpost
:wink:
raminia
06-06-2005, 05:50 PM
sorry but I have some vacational tips:
you should use
$wismm = pos($focal ,'mm');
$focal35 = round(substr($focal,0,$wismm-1)*$focal_multiplier);
$focal35 .="mm";
after line reads $focal = $exif_result['SubIFD']['FocalLength']; // Focal length
instead of $focal35 = round($focal*$focal_multiplier,0);
$focal35 .= "mm";
mightymightymax
06-06-2005, 09:05 PM
sorry but I have some vacational tips:
you should use
$wismm = pos($focal ,'mm');
$focal35 = round(substr($focal,0,$wismm-1)*$focal_multiplier);
$focal35 .="mm";
after line reads $focal = $exif_result['SubIFD']['FocalLength']; // Focal length
instead of $focal35 = round($focal*$focal_multiplier,0);
$focal35 .= "mm";
Okay, I did that and it does the same thing :cry:
fotogram
06-09-2005, 11:33 PM
I modified index.php as follows:
$tpl = str_replace("<EXIF_FOCAL_LENGTH>",$focal,$tpl);
if($focal != "")
{
// gpinto: added if block below
if($info_camera_model == "NIKON D70")
{
$focal_equiv = $focal * 1.5;
$focal = "$focal ($focal_equiv mm equiv.)";
}
//$focal = "$lang_focal $focal"; gpinto: commented out original line for the one below
$tpl = str_replace("<LANG_FOCAL_LENGTH>",$focal,$tpl);
}
This addon would be great if it supported multiple cameras. Each camera has a different conversion factor. On my site I have shots with an old Olympus and my new D70...
XerXes
03-23-2007, 01:20 PM
I know your request is two years old, but as I just modified the add-on to support multiple cameras and more or less by accident stumbled across this thread, I thought I would upload the newest version (maybe others can use it as well). The new version also incorporates raminia's modifications to make it work with more cameras.
You can download it here (same as the old download link): http://xerxes.dk/35mm.zip
Unzip it in your addons-directory and you can then add the tag <EXIF_FOCAL_LENGTH_35MM> in your template. Be sure to set the correct $focal_multiplier['camera_name'] for each of your cameras in the top of the 35mm.php-file. Instructions for adding cameras is in top of the file (although, when you look at the code, it should be pretty obvious what to do).
blinking8s
03-23-2007, 03:55 PM
updates are always welcome...thanks
XerXes
08-02-2007, 09:58 AM
Updated this addon for use with the new EXIF-system in Pixelpost 1.6.
Download it here: http://xerxes.dk/35mm.zip
Dennis
08-02-2007, 11:28 AM
Please also upload this to http://www.pixelpost.org/v1/index.php,
This way the addon will be available at the new site.
XerXes
08-03-2007, 10:39 AM
Done. I wasn't aware that the old site was still kept up to date.
Dkozikowski
08-03-2007, 02:05 PM
Done. I wasn't aware that the old site was still kept up to date.
Well. it is and it isn't.
You can still add addons and templates to the list and this is encouraged but besides that, the v1 site is outdated.
v2 has been in the works for some time and is nearing completion fairly soon!
dakwegmo
08-14-2007, 01:45 AM
The new addon is breaking my about and browse pages, and I suspect would break any page other than the showimage pages. The error that shows in my logs is:
Call to undefined function unserialize_exif() in /xxx/addons/35mm.php on line 19
This function is in includes/functions_exif.php, which doesn't get included for most pages, so the addon should check to make sure either an imageID is set, or that x is not set before running.
XerXes
08-15-2007, 08:40 AM
Thanks for the heads-up. I've fixed the bug and updated the download, both on http://xerxes.dk/35mm.zip and the old Pixelpost site.
dakwegmo
08-15-2007, 12:54 PM
That's got it. Nice work.
XerXes
08-17-2007, 01:44 PM
Just discovered a bug (very closely connected to the one previously fixed) that broke the View on map-link that is generated by the GoogleMap-addon. I fixed it so this addon will work properly also on sites with GoogleMap.
Both downloads updated.
Zenigata
08-22-2007, 12:53 AM
Useful addon: thanks!
dmitrimarkine
08-22-2007, 06:44 AM
A short while ago I made an addon which does exactly this.
You can download it here: http://xerxes.dk/35mm.zip
Unzip it in your addons-directory and you can then add the tag <EXIF_FOCAL_LENGTH_35MM> in your template. Be sure to set the correct $focal_multiplier in the top of the 35mm.php-file.
Hope this helps.
Cool,thanks
Is this addon known to have any difficulties under PP1.7RC1? When the addon is installed I get an empty addons menu. When this line
$exif_result=unserialize_exif($exif_info); // Using the function from functions_exif.php. Should be included by default when viewing a picture.
of the addon is commented out in the code, the addons menu works alright. Am I missing something obvious? Is there anything special about addon handling in PP1.7?
Thanks.
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.