Ответов: 2 Просмотров: 1519
|
Здравствуйте. Собственно сабж темы.
Есть код на страничке:
и код самого "image.php":
PHP:
скопировать код в буфер обмена
<?PHP $source = $_GET['src']; $thumb_source = $dir . '/thumbs/thumb_' . $filename; $img_source = $thumb_exists ? $thumb_source : $source; $dest = null; $image = null; $image_out = null; $save_path = ''; switch($path_info['extension']) { case 'jpg': case 'jpeg': header('content-type: image/jpeg'); break; case 'png': header('content-type: image/png'); break; case 'gif': header('content-type: image/gif'); break; } if(!$thumb_exists) { $width = 325; $height = 250; imagecopyresized($dest, $image, 0 , 0 , 0 , 0 , $width, $height, $image_width, $image_height); $image_out = $dest; $save_path = $thumb_source; } switch($path_info['extension']) { case 'jpg': case 'jpeg': break; case 'png': break; case 'gif': break; } ?>
Так вот, логика image.php:
* ищет в папке thumbs тумб картинки;
* если есть - выводит тумб;
* если нет - создает тумб и выводит его;
Тумб - создается, а вывод картинки - нет.
Что я делаю не так? Может кто разъяснить? |