0
$file = isset($_FILES['fileupload']) ? $_FILES['fileupload']['tmp_name'] : false;
$image = chunk_split(base64_encode(file_get_contents($_FILES['fileupload']['tmp_name'])));   //store image in $image

//need help here nothing prints
 $exif_ifd0 = read_exif_data($image,'IFD0' ,0);  
                    $notFound = "Unavailable"; 
                    if (@array_key_exists('Make', $image)) 
                    {
                        $camMake = $image['Make'];
                    } 
                    else
                    {
                         $camMake = $notFound;
                    }

                    echo"$camMake";
2
Contributors
3
Replies
5
Views
5 Years
Discussion Span
Last Post by cereal
0

This works for me:

<?php
    $img = "img2.jpg";
    $exif = exif_read_data($img,'IFD0');
    echo $exif['Make'];
?>

I think you don't need to do all this:

$image = chunk_split(base64_encode(file_get_contents($_FILES['fileupload']['tmp_name'])));   //store image in $image

at least not for the exif_read_data() function, just provide the name and the correct path of the file.

0

iam storing image in database long blob. when user upload a image it store in $image value. after than i want to user exif on that image.

i cant do img2.jpg scine every image name is different.

0

Mine was an example, in your case use $_FILES['fileupload']['tmp_name']; instead:

$img = $_FILES['files']['tmp_name'];
$exif = exif_read_data($img,'IFD0');
echo $exif['Make'];

bye!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.