|
Posted by Lucas on 02/15/07 07:50
Hey all,
I'm trying to use imagecopy for creating a JPEG which is a part of the
original picture.
The problem is that when I give the width, height, X and Y it creates
an image which isn't the part i like to crop.
Here is the code:
function crop_jpeg_image($x1,$y1,$w,$h,$image,$quality=95){
$srcImage=imagecreatefromjpeg($image);
if($srcImage==''){
return FALSE;
}
$destImage=imagecreatetruecolor($w,$h);
imagecopy($destImage,$srcImage,0,0,$x1,$y1,$w,$h);
if(!imagejpeg($destImage,$image,$quality)){
return FALSE;
}
imagedestroy($destImage);
imagedestroy($srcImage);
return TRUE;
}
Is there anyone who can explain me what the problem can be?
Thanks in advance,
Lucas.
Navigation:
[Reply to this message]
|