I am using this class:
class ImgResizer {
function ImgResizer($originalFile = \'$newName\') {
$this -> originalFile = $originalFile;
}
function resiz
I've written a class that will do just that and is nice and easy to use. It's called
PHP Image Magician
$magicianObj = new imageLib('racecar.jpg');
$magicianObj -> resizeImage(100, 200);
$magicianObj -> saveImage('racecar_convertd.png', 100);
It supports Read and Write (including converting) the following formats
And can read only
Example
// Include PHP Image Magician library
require_once('php_image_magician.php');
// Open JPG image
$magicianObj = new imageLib('racecar.jpg');
// Resize to best fit then crop
$magicianObj -> resizeImage(100, 200, 'crop');
// Save resized image as a PNG
$magicianObj -> saveImage('racecar_small.png');