richard_PHP Posted April 24, 2009 Share Posted April 24, 2009 hello all, back with a new problem. scenario: im wanting to display clickable thumbnails of jpegs located in a directory. ive found some code for it but after testing it, found it doesnt work and displays the following message: Warning: exif_read_data() [function.exif-read-data]: Unable to open file in Warning: exif_thumbnail(uploads) [function.exif-thumbnail]: File not supported heres the code: <?php // define directory path $dir = "uploads/"; // iterate through files // look for JPEGs if (is_dir($dir)) { if ($dh = opendir($dir)) { while (($file = readdir($dh)) !== false) { if (preg_match("/.jpg/", $file)) { // read Exchangeable Image File (EXIF) headers for info $exif = exif_read_data($file, 0, true); echo "<tr>"; // get thumbnail // link to full image echo "<td valign=top><a href=$dir/$file><imgsrc=thumbnail.php?file=$file></a><td>"; echo "<td valign=top><font size=-1>"; // get file name echo "File: <b>" . $exif['FILE']['FileName'] . "</b><br/>"; // get timestamp echo "Timestamp: " . $exif['IFD0']['DateTime'] . "<br/>"; // get image dimensions echo "Dimensions: " . $exif['COMPUTED']['Height'] . " x " . $exif['COMPUTED']['Height'] . " <br/>"; // get camera make and model echo "Camera: " . $exif['IFD0']['Model']; echo "</font></td>"; echo "</tr>"; $image = exif_thumbnail($dir . "/" . $_GET['file']); header("Content-Type: image/jpeg"); echo $image; } } closedir($dh); } } ?> i appreciate all help and also if anyone has working code i would appreciate (and will reference) the code. many thanks! Link to comment https://forums.phpfreaks.com/topic/155544-solved-exif-problems/ Share on other sites More sharing options...
richard_PHP Posted April 24, 2009 Author Share Posted April 24, 2009 anyone care to help with this one? Link to comment https://forums.phpfreaks.com/topic/155544-solved-exif-problems/#findComment-818578 Share on other sites More sharing options...
richard_PHP Posted April 24, 2009 Author Share Posted April 24, 2009 got it working Link to comment https://forums.phpfreaks.com/topic/155544-solved-exif-problems/#findComment-818645 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.