1 - I use a script that uploads and stores jpg's and as it does so it creates variable '$photo' which contains the name of the jpg and the directory it is stored in.
I also set a second variable called '$thumb' which contains the name and location of a thumbnail of the jpg which is created and stored by the upload script.
2 - On completion of the upload an exif extraction script is launched which starts by using the '$photo' variable to create a variable called '$Image' which is used at various points in the script after exif extraction - for example to fetch and display the image as well store the image details in a sql database.
When I run the script it creates a PHP error saying that the 'exif_read_data' function cannot find the file.
So in the script I set some 'echo' commands to verify the contents of the variables, as well as too check that the file held by the variable exists.
This is the script code:
Code: Select all
$Image = $photo;
echo "$photo";
echo $Image;
echo file_exists($Image) ? 'ok' : ' image file not found';
echo file_exists($photo) ? 'ok' : ' photo file not found';
echo $thumb;
echo file_exists($thumb) ? 'ok' : ' thumb file not found';
$exif = exif_read_data($photo, 0, true);
Code: Select all
original/raleighbike.jpg - content of variable $photo (correct)
original/raleighbike.jpg - content of variable $Image (correct)
image file not found - when checking for the file in $Image (incorrect, file does exist)
photo file not found - when checking for the file in $photo (incorrect, file does exist)
thumb file not found - when checking for the file in $thumb (incorrect, file does exist)
thumbnail/thumb_raleighbike.jpg
BUT the 'exif_read_data' function cannot find the files returning the error
Code: Select all
[02-Apr-2013 18:45:29 America/Chicago] PHP Warning: exif_read_data() [<a href='function.exif-read-data'>function.exif-read-data</a>]: Unable to open file in /home2/webi8726/public_html/domain.com/sqlsidebar/displayexif.php on line 23
I have tried searching for any clues as to why this happens, and also asked various php 'experts' and not yet come up with an answer to the problem.
Can anyone here suggest a solution?? - here's hoping