Menu
Is there a built in function to preserve the resolution of the original image when using imagecopy()? I’ve noticed even if I process the entire file it’s output is half the file-size of the original. The quality is noticeably less as well. This is the code to output the cropped image.
[code=php]
$w = $_REQUEST[‘w’];
$h = $_REQUEST[‘h’];
$x = $_REQUEST[‘x’];
$y = $_REQUEST[‘y’];
header (“Content-type: image/jpg”);
$src = @imagecreatefromjpeg(“images/mypic.jpg”);
$im = @imagecreatetruecolor($w, $h);
imagecopy($im,$src,0,0,$x,$y,$w,$h);
imagejpeg($im);
imagedestroy($im);