1 2 3 4 5 6 7 8 9 10
|
$imagepath = "images_temp/pouet.jpg";
move_uploaded_file($_FILES['userfile']['tmp_name'],$imagepath);
chmod ($imagepath, 0644);
$image_source = imageCreateFromJpeg($imagepath);
$thumb_destination=ImageCreateTrueColor($new_thumb_width,$new_thumb_height) OR die("Pas pu faire ImageCreateTrueColor");
imagecopyresampled($thumb_destination,$image_source,0,0,0,0,$new_thumb_width,$new_thumb_height,ImageSX($image_source),ImageSY($image_source));
Imagejpeg($thumb_destination, $_SERVER["DOCUMENT_ROOT"]."/albums/thumbs/".$picture_name);
imagedestroy($image_source);
imagedestroy($thumb_destination); |
Partager