mirror of
https://github.com/php/php-src.git
synced 2024-12-11 19:04:38 +08:00
7a8cade379
This initial checkin has no changes to any of the libgd code so it can be used as a basis for diffs. It also will not build currently because of this. The PHP gd checks need to be incorporated along with a bit of other config magic. It also shouldn't break the build and will only take effect if you use --with-gd=php right now.
39 lines
805 B
C
39 lines
805 B
C
#include <stdio.h>
|
|
#include <math.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#include "gd.h"
|
|
|
|
#define TRUE 1
|
|
#define FALSE 0
|
|
|
|
/* Exported functions: */
|
|
extern void gdImagePngToSink (gdImagePtr im, gdSinkPtr out);
|
|
extern gdImagePtr gdImageCreateFromPngSource (gdSourcePtr inSource);
|
|
|
|
/* Use this for commenting out debug-print statements. */
|
|
/* Just use the first '#define' to allow all the prints... */
|
|
/*#define GD_SS_DBG(s) (s) */
|
|
#define GD_SS_DBG(s)
|
|
|
|
void
|
|
gdImagePngToSink (gdImagePtr im, gdSinkPtr outSink)
|
|
{
|
|
gdIOCtx *out = gdNewSSCtx (NULL, outSink);
|
|
gdImagePngCtx (im, out);
|
|
out->free (out);
|
|
}
|
|
|
|
gdImagePtr
|
|
gdImageCreateFromPngSource (gdSourcePtr inSource)
|
|
{
|
|
gdIOCtx *in = gdNewSSCtx (inSource, NULL);
|
|
gdImagePtr im;
|
|
|
|
im = gdImageCreateFromPngCtx (in);
|
|
|
|
in->free (in);
|
|
|
|
return im;
|
|
}
|