 |
|
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'xxxxxx.jpg' for writing : permission denied in 'xxxxxx.php' online 222
ขึ้น error ตามข้างบนครับ
Code (PHP)
$size = getimagesize("myphoto/".$rowpic['name_photo']);
if($size[0] > $size[1]){ //กว้าง > สูง
$images = 'myphoto/'.$rowpic['name_photo'];
$new_images = "img-th/".$images;
$width=650; //*** Fix Width & Heigh (Autu caculate) ***//
$size=GetimageSize($images);
$height=round($width*$size[1]/$size[0]);
$images_orig = ImageCreateFromJPEG($images);
$photoX = ImagesX($images_orig);
$photoY = ImagesY($images_orig);
$images_fin = ImageCreateTrueColor($width, $height);
ImageCopyResampled($images_fin, $images_orig, 0, 0, 0, 0, $width+1, $height+1, $photoX, $photoY);
ImageJPEG($images_fin,$new_images);
ImageDestroy($images_orig);
ImageDestroy($images_fin);
}
เกี่ยวกับการย่อไฟล์ภาพ
Tag : PHP, MySQL, HTML/CSS
|
ประวัติการแก้ไข 2015-12-24 19:09:33
|
 |
 |
 |
 |
Date :
2015-12-24 19:08:35 |
By :
nook563 |
View :
874 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |