Win32 optimizing compiler causes color loss in gdImageCopyResampled()
| From: | Keith Craigie | Date: | Thu, 16 Aug 2007 16:48:31 +0000 |
| Subject: | Win32 optimizing compiler causes color loss in gdImageCopyResampled() | ||
| Groups: | php.gd.devel | ||
| Request: | Send a blank email to php-gd-devel+get-240@lists.php.net to get a copy of this message | ||
Hello,
Great library! I found that with MS Visual Studio 8 (compiler version
14.00.50727.42) with global optimizations on (/O2) and libgd release 2.0.35,
there is an issue with the gdImageCopyResampled() in gd/gd.c. Apparently
the MS compiler in its optimization causes a weird bug where it seems color
information is while scaling the image. I was able to work around this bug
by using floor() instead of the (long) cast in the floor2() macro directly
above the function. See the attached patch.
Best,
Keith