<?php
$filename = " آدرس عکس ";
// طول و عرض جديد عکس
$intWidth = 140;
// طول و عرض جديد عکس
$intHeight = 140;
$percent = 100;
LIST($width, $height) = getimagesize($filename);
IF($intWidth != 0 AND $intHeight != 0)
{
$newwidth = $intWidth;
$newheight = $intHeight;
}
ELSE
{
$newwidth = $width * $percent;
$newheight = $height * $percent;
}
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// imagejpeg($thumb,' آدرس براي ذخيره عکس ');
imagejpeg($thumb,'newPic.jpg');
?>