Okay, the reason I posted this is because I wasn\'t sure what to search for. I\'ll try to explain it as clearly as I can.
Say, I have an image sized 800x600. The box
$ratio_orig) {
$width = floor($height*$ratio_orig);
} else {
$height = floor($width/$ratio_orig);
}
// Resample
$tempimg = imagecreatetruecolor($width, $height);
imagecopyresampled($tempimg, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
imagejpeg($tempimg, $thumbname, 80);
}
if (!function_exists('sys_get_temp_dir')) {
function sys_get_temp_dir() {
if (!empty($_ENV['TMP'])) { return realpath($_ENV['TMP']); }
if (!empty($_ENV['TMPDIR'])) { return realpath( $_ENV['TMPDIR']); }
if (!empty($_ENV['TEMP'])) { return realpath( $_ENV['TEMP']); }
$tempfile=tempnam(uniqid(rand(),TRUE),'');
if (file_exists($tempfile)) {
unlink($tempfile);
return realpath(dirname($tempfile));
}
}
}
?>
Save the file as imageresize.php and put this file in your image folder and just use the code like this to show image
" />
you can use this code to show images in different sizes.