$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";

Recommended Answers

All 3 Replies

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.

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.

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.