You are here: PHP: imagecopy problem « PHP Programming Language « IT news, forums, messages
PHP: imagecopy problem

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация