Connie
03-02-2005, 09:50 PM
this message was added by the user "commando"
sorry, I had to copy this posting and place it here :cry:
===================
Is there a markup for Iso speed?
ISO Speed is not in there, but it is easy to add. The following are my changes to the EXIF section of index.php. Notice that I don't like the extra text added to my tags, I prefer to do that in my template. Also, for some reason, my camera prints the focal length as 800/10, so I convert it. I have also added the 35mm equivilent focal length so that I can compare between cameras... Enjoy 8)
// EXIF STUFF
if(extension_loaded(exif)) {
$curr_image = "images/$image_name";
$all_exif = exif_read_data($curr_image,0,true);
$exif = $all_exif['EXIF'];
//echo "<pre>"; print_r($all_exif); echo "</pre>";
$exposure = $exif['ExposureTime'];
$exifhtml = $all_exif['COMPUTED'];
$aperture = pullout($exifhtml['ApertureFNumber']);
$capture_date = $exif['DateTimeOriginal'];
$flash = $exif['Flash'];
$lens = pullout($exif['LensModel']);
$focal = pullout($exif['FocalLength']);
$pos = strpos( $focal, "/" );
if( $pos ) {
list($e, $d) = sscanf($focal, "%d/%d");
$focal = sprintf( "%d", intval($e/$d) );
}
$iso = pullout($exif['ISOSpeedRatings']);
$focal35mm = pullout($exif['FocalLengthIn35mmFilm']);
$ifd = $all_exif['IFD0'];
$info_camera_manu = $ifd['Make'];
$info_camera_model = $ifd['Model'];
if($flash == 0) {
$flash = "$lang_flash_not_fired";
} else {
$flash = "$lang_flash_fired";
}
if($iso != "") { $iso = "ISO $iso"; }
//if($exposure != "") { $exposure = "$lang_exposure $exposure"; }
//if($aperture != "") { $aperture = "$lang_aperture $aperture"; }
//if($capture_date != "") { $capture_date = "$lang_capture_date $capture_date"; }
//if($focal != "") { $focal = "$lang_focal $focal"; }
//if($info_camera_manu != "") { $info_camera_manu = "$lang_camera_maker $info_camera_manu"; }
//if($info_camera_model != "") { $info_camera_model = "$lang_camera_model $info_camera_model"; }
$tpl = ereg_replace("<EXIF_EXPOSURE_TIME>",$exposure,$tpl);
$tpl = ereg_replace("<EXIF_APERTURE>",$aperture,$tpl);
$tpl = ereg_replace("<EXIF_CAPTURE_DATE>",$capture_date,$tpl);
$tpl = ereg_replace("<EXIF_FLASH>",$flash,$tpl);
$tpl = ereg_replace("<EXIF_FOCAL_LENGTH>",$focal,$tpl);
$tpl = ereg_replace("<EXIF_35MM_FOCAL_LENGTH>",$focal35mm,$tpl);
$tpl = ereg_replace("<EXIF_CAMERA_MAKE>",$info_camera_manu,$tpl);
$tpl = ereg_replace("<EXIF_CAMERA_MODEL>",$info_camera_model,$tpl);
$tpl = ereg_replace("<EXIF_LENS>",$lens,$tpl);
$tpl = ereg_replace("<EXIF_ISO>",$iso,$tpl);
}
sorry, I had to copy this posting and place it here :cry:
===================
Is there a markup for Iso speed?
ISO Speed is not in there, but it is easy to add. The following are my changes to the EXIF section of index.php. Notice that I don't like the extra text added to my tags, I prefer to do that in my template. Also, for some reason, my camera prints the focal length as 800/10, so I convert it. I have also added the 35mm equivilent focal length so that I can compare between cameras... Enjoy 8)
// EXIF STUFF
if(extension_loaded(exif)) {
$curr_image = "images/$image_name";
$all_exif = exif_read_data($curr_image,0,true);
$exif = $all_exif['EXIF'];
//echo "<pre>"; print_r($all_exif); echo "</pre>";
$exposure = $exif['ExposureTime'];
$exifhtml = $all_exif['COMPUTED'];
$aperture = pullout($exifhtml['ApertureFNumber']);
$capture_date = $exif['DateTimeOriginal'];
$flash = $exif['Flash'];
$lens = pullout($exif['LensModel']);
$focal = pullout($exif['FocalLength']);
$pos = strpos( $focal, "/" );
if( $pos ) {
list($e, $d) = sscanf($focal, "%d/%d");
$focal = sprintf( "%d", intval($e/$d) );
}
$iso = pullout($exif['ISOSpeedRatings']);
$focal35mm = pullout($exif['FocalLengthIn35mmFilm']);
$ifd = $all_exif['IFD0'];
$info_camera_manu = $ifd['Make'];
$info_camera_model = $ifd['Model'];
if($flash == 0) {
$flash = "$lang_flash_not_fired";
} else {
$flash = "$lang_flash_fired";
}
if($iso != "") { $iso = "ISO $iso"; }
//if($exposure != "") { $exposure = "$lang_exposure $exposure"; }
//if($aperture != "") { $aperture = "$lang_aperture $aperture"; }
//if($capture_date != "") { $capture_date = "$lang_capture_date $capture_date"; }
//if($focal != "") { $focal = "$lang_focal $focal"; }
//if($info_camera_manu != "") { $info_camera_manu = "$lang_camera_maker $info_camera_manu"; }
//if($info_camera_model != "") { $info_camera_model = "$lang_camera_model $info_camera_model"; }
$tpl = ereg_replace("<EXIF_EXPOSURE_TIME>",$exposure,$tpl);
$tpl = ereg_replace("<EXIF_APERTURE>",$aperture,$tpl);
$tpl = ereg_replace("<EXIF_CAPTURE_DATE>",$capture_date,$tpl);
$tpl = ereg_replace("<EXIF_FLASH>",$flash,$tpl);
$tpl = ereg_replace("<EXIF_FOCAL_LENGTH>",$focal,$tpl);
$tpl = ereg_replace("<EXIF_35MM_FOCAL_LENGTH>",$focal35mm,$tpl);
$tpl = ereg_replace("<EXIF_CAMERA_MAKE>",$info_camera_manu,$tpl);
$tpl = ereg_replace("<EXIF_CAMERA_MODEL>",$info_camera_model,$tpl);
$tpl = ereg_replace("<EXIF_LENS>",$lens,$tpl);
$tpl = ereg_replace("<EXIF_ISO>",$iso,$tpl);
}