This is my code, for resize test/15378596684270_1.jpg
from 136x136px
to 48x48px
but when test code , its' not resize any image how can i do ?
<?PHP
session_start();
include("connect.php");
$file = "test/15378596684270_1.jpg";
list($width, $height) = getimagesize($file);
$newwidth = "48";
$newheight = "48";
$image_info = getimagesize($file);
if ($image_info['mime'] == 'image/jpeg') {
$src = imagecreatefromjpeg($file);
} elseif ($image_info['mime'] == 'image/gif') {
$src = imagecreatefromgif($file);
} elseif ($image_info['mime'] == 'image/png') {
$src = imagecreatefrompng($file);
}
$tgt = imagecreatetruecolor(48, 48);
imagecopyresampled($tgt, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
?>