|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-11-15 09:11 UTC] sniper@php.net
[2002-11-15 13:34 UTC] tkirby at virginiaartists dot net
[2002-11-15 13:39 UTC] sniper@php.net
[2002-11-15 15:20 UTC] tkirby at virginiaartists dot net
[2002-11-15 15:24 UTC] derick@php.net
[2002-11-15 15:42 UTC] tkirby at virginiaartists dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 08:00:02 2025 UTC |
Resized images generated from jpg files displaying botched or dimmed colors after update from 4.2.2 to 4.2.3. Example code: # get the data from the original, large image $src_img = ImageCreateFromJPEG($image); # create new image $dst_img = ImageCreate($new_w,$new_h); # allocate colors for background and border $mattecolor = ImageColorAllocate($dst_img,$mr,$mg,$mb); $bordercolor = ImageColorAllocate($dst_img,$br,$bg,$bb); # fill image with matte color ImageFill($dst_img,0,0,$mattecolor); # resize source image and place the copy in the destination image ImageCopyResized($dst_img,$src_img, $margin_x,$margin_y, 0,0,$thumb_w,$thumb_h, $old_x,$old_y); # if there is a border set, draw a rectangle around the thumbnail if ($border==1){imageRectangle($dst_img,0,0,$new_w-1,$new_h-1,$bordercolor);} # create final image and free up the memory ImageJPEG($dst_img); ImageDestroy($dst_img);