Скажите, а как сначала проверить существует ли файл по ссылке $name?
Я пробовал так:
PHP:
скопировать код в буфер обмена
<?PHP
header("Content-type: image/jpeg");
$name = "http://absurdu.net/wp-content/uploads/2009/05/_mg_2096.jpg";
if (@fopen(''.$name, "r")) {
$w = 355;
$quality = 90;
if ($ext == ".gif") {
} elseif ($ext == ".jpg" or $ext == "jpeg") {
} elseif ($ext == ".png"){
}
if ($width != $w)
{
$ratio = $width/$w;
$new_width = round ($width/$ratio); $new_height = round ($height/$ratio); imagecopyresampled ($new_image, $image, 0
, 0
, 0
, 0
, $new_width, $new_height, $width, $height); imagejpeg ($new_image, 'proba/1.jpg', $quality); }
}
else {
echo "Файл не найден";
}
?>