Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.138.134.77
#include <stdio.h>
#include <stdlib.h>
#include "gd.h"
#include "gdtest.h"
int main()
{
gdImagePtr im, exp;
FILE *fp;
int error = 0;
fp = gdTestFileOpen("gdimagerotate/php_bug_64898.png");
(void)fp;
im = gdImageCreateTrueColor(141, 200);
if (!im) {
gdTestErrorMsg("loading failed.\n");
return 1;
}
gdImageFilledRectangle(im, 0, 0, 140, 199, 0x00ffffff);
/* Try default interpolation method, but any non-optimized fails */
/* gdImageSetInterpolationMethod(im, GD_BICUBIC_FIXED); */
exp = gdImageRotateInterpolated(im, 45, 0x0);
if (!exp) {
gdTestErrorMsg("rotating image failed.\n");
gdImageDestroy(im);
return 1;
}
if (!gdAssertImageEqualsToFile("gdimagerotate/php_bug_64898_exp.png", exp)) {
gdTestErrorMsg("comparing rotated image failed.\n");
error = 1;
}
gdImageDestroy(exp);
gdImageDestroy(im);
return error;
}
|