Summary: | Color Distortion with PHP and GD Image Library | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | PJ <PJ> |
Component: | [OLD] Development | Assignee: | PHP Bugs <php-bugs> |
Status: | RESOLVED INVALID | ||
Severity: | normal | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | http://us4.php.net/manual/en/function.imagecopyresized.php | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Code to demonstrate the bug.
What I see |
Description
PJ
2004-01-19 02:32:22 UTC
Created attachment 24066 [details]
Code to demonstrate the bug.
Created attachment 24067 [details]
What I see
(Props go to Seemant for being my gennie pig).
i had this bug once and i got around it by doing this: $localpic = "some.jpg"; $im = imagecreatefromjpeg($localpic); $w = 100; $h = 100; $thumb = imagecreatetruecolor($w,$h); $specs = getimagesize($localpic); imagecopyresized($thumb, $im, 0, 0, 0, 0, $w, $h, $specs[0], $specs[1]); $thumbfile = $localpic ."_thumb.jpg"; ImageJpeg($thumb,$thumbfile,100); basically when i used imagecreate() i got the crappy quality and when i used truecolor, it worked fine the reason can be found at the URL provided above |