thank for replay
I solve the problem. Resize do via browser. When images crashed or missed i call office image! Here is my script:
<?
header("Content-type: image/jpeg");
function loadjpeg($path, $max_x, $max_y) {
$im = @imagecreatefromjpeg($path);
if (!$im) {
$office = 'no_pic.gif';
// Content type
header('Content-type: image/gif');
// Get new dimensions
list($width, $height) = getimagesize($office);
$new_width = 100;
$new_height= 75;
// Resample
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefromgif($office);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
// Output
imagegif($image_p, null, 100);
}
if ($max_x != 0 && $max_y != 0) {
$x = 100;
$y= 75;
if (imagesx($im) != $x || imagesy($im) != $y) {
$tmp = imagecreatetruecolor($x, $y);
imagecopyresampled($tmp, $im, 0, 0, 0, 0, $x, $y, imagesx($im), imagesy($im));
imagedestroy($im);
$im = $tmp;
}
}
return $im;
}
$qwerty="my_image.jpg".$pic;
$jpg = loadjpeg("$qwerty",150,150);
//Display new image in browser, quality 50%
Header("Content-type: image/jpeg");
imagejpeg($jpg,'',50);
?>
CHEERS!