- edited description
gdImageCopyResampled broken when built with Visual C++ 2010 32-bit due to floor2() "smart" cast
The gdImageCopyResampled() function is broken when built with Visual C++ 2010 32-bit (with full optimization, -O2) due to floor2() "smart" cast. The result is generally a white image with colored artifacts, rather than the re-sampled image.
This is most probably a compiler optimization bug, so this is not directly a GD bug. But I open the ticket for people who might get similar troubles :)
The bug is triggered by the following line in gd.c: sx = floor2 (sx);
Possible fix is to do the following in gd.c:
{{{ #if (defined(_WIN32) && defined(_M_IX86) && defined(_MSC_VER) && _MSC_VER == 1600) / Do not use optimized version due to possible compiler bug with VC++2010/ix86. / #define floor2(exp) floor(exp) #else #define floor2(exp) ((long) (exp)) #endif }}}
Comments (7)
-
reporter -
reporter - edited description
-
reporter - edited description
-
reporter - edited description
-
Please try using current master, this issue may look like a rounding issue in gdImageCopyResampled. A fix has been merged.
-
- changed milestone to 2.1.0
- edited description
-
- changed status to resolved
- Log in to comment