Jump to content

Help Please :)


Recommended Posts

Hi, I am a bit of a newbie. I am making a photography website for myself.

 

I am making a uploader in the back end that enables me to upload a photo, when the photo is uploaded, I want a piece of code that strips the EXIF data from the photo and puts it in a database... This is where I am stuck :(

 

I would be overly greatful if anyone could help me get started :)

 

To anyone that replies... Thankyou

 

Chris

Link to comment
https://forums.phpfreaks.com/topic/106137-help-please/
Share on other sites

When you submit the form call the exif_read_data(); function

 

Info here: http://us2.php.net/manual/en/function.exif-read-data.php

 

If you don't know how to create an upload form already, let us know we would be glad to help. Here's an example usage of the exif function.

 

<?php

$image = image here;
$exif = exif_read_data('$image', 'IFD0');
echo $exif===false ? "No header data found.<br />\r\n" : "Image contains headers<br />\r\n";

$exif = exif_read_data('$image', 0, true);

echo "File Name: " . $exif['FILE']['FileName'] . "\r\n";
echo "File Size: " . $exif['FILE']['FileSize'] . "\r\n";
echo "File Date Time: " . $exif['FILE']['FileDateTime'] . "\r\n";
echo "Width: " . $exif['COMPUTED']['Width'] . "\r\n";
echo "Height: " . $exif['COMPUTED']['Height'] . "\r\n";
?>

 

In theory this SHOULD work..just edit to your liking...as for the database part...

 

Have a look at this link... http://www.110mb.com/forum/beginnertutorial-on-the-mysql-basics-t17770.0.html

 

If you need any more help just let us know!

 

Edit: Also note, this function is only in PHP 4.2.0 or higher.

Link to comment
https://forums.phpfreaks.com/topic/106137-help-please/#findComment-544010
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.