|
#1
|
|||
|
|||
|
Mod for EXIF / copied from other not adequate posting
this message was added by the user "commando"
sorry, I had to copy this posting and place it here :cry: =================== Quote:
Code:
// 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);
}
|
|
#2
|
|||
|
|||
|
moved from other topic to here
Quote:
|
|
#3
|
|||
|
|||
|
Some of the lines in the post have been word wrapped by the board. Make sure that you join all of the lines that are not indented back to the previous line in your code. It is probably those lines with just the } on them that are causing the most problem since they should be commented out in the previous line... :wink:
The next thing you will want to do is add the new tags to your template. <EXIF_35MM_FOCAL_LENGTH> // This only works with my SLR, not my Olympus, give it a try <EXIF_ISO> // Should be supported by most cameras Also, don't forget that I removed the extra text from most of the EXIF tags, so you will need to add that to the template if you want it. I didn't want text like "Aperature:" forced on me. Hope this helps. Check out my website to see it in action. Reply to this if not, I am watching this topic now... |
|
#4
|
|||
|
|||
|
not sure what im doing wrong here everytime i edit it even when i make sure it should look the way you had it with out word warp - it still gives me a blank page... =\
__________________
my pixelpost photoblog |
|
#5
|
|||
|
|||
|
Email your edited index.php to me at rob at prouse.org and I will take a look at it for you, fix it and send it back.
|
|
#6
|
||||
|
||||
|
@Commando
Nice Avatar!
__________________
Photoblog: http://pblog.raminia.com Powered by Pixelpost 1.7 |
|
#7
|
||||
|
||||
|
Quote:
If you replace the empty spaces at each code line in the beginning with a TAB (4 empty spaces = 1 TAB), then you should be fine. You need to do that in a word processor where you can see the hidden stuff like returns and spaces, you then will notice that they look different than standard text input. |
|
#8
|
|||
|
|||
|
Is there anyway to format the way the date/time turns out?
|
|
#9
|
|||
|
|||
|
did you try the date-format-option in the admin panel ?
|
|
#10
|
|||
|
|||
|
Quote:
Code:
$capture_date = $exif['DateTimeOriginal']; $capture_date = strtotime($image_datetime); $capture_date = date($cfgrow['dateformat'],$capture_date); |
| Post Reply |
| Thread Tools | |
|
|