PDA

View Full Version : Add on that does not work with upgrade(35mm equivalent focal-info)


Jeff A
03-26-2007, 05:22 AM
I found that the 35mm equivalent focal-info (Ramin's modified version) add on does not work with the 1.6 beta. When I tried to view my blog I got a blank screen. If you are suing this plug-in you will need to disable it.

Dennis
03-26-2007, 05:27 AM
This addon uses the 'old' way of retrieving exif information. Not all addons have been updated to reflect the changes made in Pixelpost. Please sent me the addon and I can probably fix this.

Jeff A
03-26-2007, 05:33 AM
Sent it, I think I did that right. If not let me know.

Dennis
03-26-2007, 07:10 AM
I've updated it. I've noticed an updated version on the forum, I'll post code to update this one to.

Let me know if it works.

dakwegmo
03-26-2007, 04:38 PM
I think most of the addons that do stuff with EXIF info will need to be updated.

Dennis
03-26-2007, 05:01 PM
I know you're right :D

Dennis
03-28-2007, 11:07 AM
Here is the correct addon code:


<?php
include_once('../includes/functions_exif.php');

$focal_multiplier = 6.49; // 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";
$image_exif = unserialize_exif($row['exif_info']);
$focal = $exif_result['FocalLengthSubIFD']; // focal length
// ramin added for FinePix S5500
$wismm = pos($focal,'mm');
$focal35= round(substr($focal,0,$wismm-1)*$focal_multiplier);
$focal35 .= 'mm';

$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 (Ramin's modified version) For Pixelpost 1.6";
$addon_description = "This addon enables the tag <EXIF_FOCAL_LENGTH_35MM>, 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. The multiplier is now set to " .$focal_multiplier;

$addon_version = "0.3";
?>

outbackcamera
05-15-2007, 05:53 PM
Here is the correct addon code:



$image_exif = unserialize_exif($row['exif_info']);
$focal = $exif_result['FocalLengthSubIFD']; // focal length



I have been using the latest version of this addon that was posted in the other thread for this. I modified it to use the new exif methods as shown above from Schonhose's post here and now find that it does not work. The old exif functions work ok.

I think you may need to change the second line above to read:
$focal = $image_exif['FocalLengthSubIFD']; // focal length

However, this code still seems to fail on the unserialize_exif function call. I have included the functions_exif file in the addon but still have a problem with this function.

Could be that I have just missed something blindingly obvious...any clues?

Dennis
05-15-2007, 06:37 PM
this should work:


<?php
include_once('../includes/functions_exif.php');

$focal_multiplier = 6.49; // 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";
$image_exif = unserialize_exif($row['exif_info']);
$focal = $image_exif['FocalLengthSubIFD']; // focal length
// ramin added for FinePix S5500
$wismm = pos($focal,'mm');
$focal35= round(substr($focal,0,$wismm-1)*$focal_multiplier);
$focal35 .= 'mm';

$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 (Ramin's modified version) For Pixelpost 1.6";
$addon_description = "This addon enables the tag <EXIF_FOCAL_LENGTH_35MM>, 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. The multiplier is now set to " .$focal_multiplier;

$addon_version = "0.3";
?>

outbackcamera
05-15-2007, 08:18 PM
ok I had to remove the "../" from the include line as the working directory is toplevel PP directory when this addon is executed.

Also, you do need to change the line
$focal = $exif_result['FocalLengthSubIFD']; // focal length to

$focal = $image_exif['FocalLengthSubIFD']; // focal length

because you want to get the exif data from the array $image_exif that is returned from the unserialize function.

Dennis
05-15-2007, 08:23 PM
ok.. it was quick&dirty with not much sleep. Something I intend to get in a few minutes