note 36242 deleted from function.imagecopyresampled by aidan
| From: | aidan@php.net | Date: | Mon, 04 Oct 2004 09:43:56 +0000 |
| Subject: | note 36242 deleted from function.imagecopyresampled by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-77951@lists.php.net to get a copy of this message | ||
Note Submitter: code_couturier at graffiti dot net
----
# if you using an old gd-version (4.2.x php+bundle)
# imagecopyresampled doesn't work correct because
# the src_x and src_y values are ignored.
# here is a (bum-bum) solution to solve this
# problem without fixing it ( ;
# first, copy the part you want into a temporary image
# at position 0,0
imagecopy ($tmp_img, $img,0,0,$posx,$posy, $sizex,$sizey);
# than use another image to copy and resample it,
# to get a larger/smaller version of it
imagecopyresampled ($img_new,$tmp_img,0,0,0,0,$new_sizex, $new_sizey, $sizex,$sizey);
# and than you can use it in your own image
imagecopymerge ($my_img,$img_new,
$myposx,$myposy,0,0,$new_sizex,$new_sizey,$alpha_value);