/ Published in: PHP
URL: http://www.phptoys.com/e107_plugins/content/content.php?content.46
Expand |
Embed | Plain Text
<?php function resizeImage($originalImage,$toWidth,$toHeight){ // Get the original geometry and calculate scales $xscale=$width/$toWidth; $yscale=$height/$toHeight; // Recalculate new size with default ratio if ($yscale>$xscale){ } else { } // Resize the original image $imageResized = imagecreatetruecolor($new_width, $new_height); $imageTmp = imagecreatefromjpeg ($originalImage); imagecopyresampled($imageResized, $imageTmp, 0, 0, 0, 0, $new_width, $new_height, $width, $height); return $imageResized; } ?>
You need to login to post a comment.
