Просмотр поста

.
Koenig
(\/)____o_O____(\/)

Вот на колдовал

foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator('.')) as $file) {
if (preg_match('/(.jpg|.jpeg|.tif|.tiff)$/i', $file->getFilename())) {
$thumbdata = exif_thumbnail($file->getPathname(), $width, $height, $type);
$exif = exif_read_data($file->getPathname());
if ($thumbdata !== false) {
#$mime = image_type_to_mime_type($type);
#$ext = ($mime == 'image/tiff') ? '.tif' : '.jpg';
#$outfile = substr(realpath($file->getPathname()), 0, strrpos(realpath($file->getPathname()), '.')) . '_thumb' . $ext;
#file_put_contents($outfile, $thumbdata) or die('Cannot write file: ' . $outfile);
$img = '<img  width="' . $width . '" height="' . $height . '" src="data:image/gif;base64,' . chunk_split(base64_encode($thumbdata)) . '" alt="pic" />';
if (is_array($exif)) {
echo '<pre>';
print_r($exif);
echo '</pre>';
}
echo $img;
}
}
}

Читает папку текущую, и все картинки просматривает на возможнось уменьшить, и сразу их вывод с не плохим сжатием, и инф о картинке