I currently have a section of my site where the user uploads a picture and provide their first and last name...
Is there a way that there name can be embedded into there picture and then saved?
I currently have a section of my site where the user uploads a picture and provide their first and last name...
Is there a way that there name can be embedded into there picture and then saved?
A Watermark will fill your needs :)
<?php
function watermarkImage ($SourceFile, $WaterMarkText, $DestinationFile) {
list($width, $height) = getimagesize($SourceFile);
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromjpeg($SourceFile);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width, $height);
$black = imagecolorallocate($image_p, 0, 0, 0);
$font = 'arial.ttf';
$font_size = 10;
imagettftext($image_p, $font_size, 0, 10, 20, $black, $font, $WaterMarkText);
if ($DestinationFile<>'') {
imagejpeg ($image_p, $DestinationFile, 100);
} else {
header('Content-Type: image/jpeg');
imagejpeg($image_p, null, 100);
};
imagedestroy($image);
imagedestroy($image_p);
};
?>
Source: http://www.phpjabbers.com/put-watermark-on-images-using-php-php20.html
You have a lot of possibilities to do that. It depends on the infrastructure, the servers and the languages/technologies you are using or want to use...
1) You can store the meta-data in a database and add the link to the picture to it. (a often very used way)
2) you can store the meta-data in the database and the picture file as well
3) you can try to handle with exif data (How do I add exif data to an image?) (I've never done that)
4) another way would be to store the meta-data in a xml file wich is stored at the same place than the picture...