This source file includes following definitions.
- gdImagePngToSink
- gdImageCreateFromPngSource
- gdImagePngToSink
- gdImageCreateFromPngSource
1 #include <stdio.h>
2 #include <math.h>
3 #include <string.h>
4 #include <stdlib.h>
5 #include "gd.h"
6
7 #define TRUE 1
8 #define FALSE 0
9
10
11 extern void gdImagePngToSink (gdImagePtr im, gdSinkPtr out);
12 extern gdImagePtr gdImageCreateFromPngSource (gdSourcePtr inSource);
13
14
15
16
17 #define GD_SS_DBG(s)
18
19 #ifdef HAVE_LIBPNG
20 void gdImagePngToSink (gdImagePtr im, gdSinkPtr outSink)
21 {
22 gdIOCtx *out = gdNewSSCtx(NULL, outSink);
23 gdImagePngCtx(im, out);
24 out->gd_free(out);
25 }
26
27 gdImagePtr gdImageCreateFromPngSource (gdSourcePtr inSource)
28 {
29 gdIOCtx *in = gdNewSSCtx(inSource, NULL);
30 gdImagePtr im;
31
32 im = gdImageCreateFromPngCtx(in);
33
34 in->gd_free(in);
35
36 return im;
37 }
38 #else
39 void gdImagePngToSink (gdImagePtr im, gdSinkPtr outSink)
40 {
41 php_gd_error("PNG support is not available");
42 }
43 gdImagePtr gdImageCreateFromPngSource (gdSourcePtr inSource)
44 {
45 php_gd_error("PNG support is not available");
46 return NULL;
47 }
48 #endif
49