Win32 optimizing compiler causes color loss in gdImageCopyResampled()
[email protected] ("Keith Craigie")
| Newsgroups | php.gd.devel |
|---|---|
| Message-ID | <[email protected]> |
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