ports/lang/php5/files/patch-ext::gd::libgd::gd_gif_out.c
Norikatsu Shigemura 2efdd507c9 o Switch to libtool 1.4.
o Add WITHOUT_IPV6 knob (Requested by Jens Rehsack <rehsack@liwing.de>
  in ports/53754, implemented in a slightly different way).
o Add GIF and animated GIF write support by default in GD and add
  WITH_LZW knob to enable the LZW compression algorithm (patented
  in some countries).
o Removed gd_gif_out.diff patch and added many new patches.

PR:		ports/53754, ports/53879
Requested by:	Jens Rehsack <rehsack@liwing.de>
Submitted by:	Alex Dupre <sysadmin@alexdupre.com> (maintainer)
2003-07-03 06:02:38 +00:00

73 lines
1.9 KiB
C

--- ext/gd/libgd/gd_gif_out.c.orig Sat Jun 28 15:47:56 2003
+++ ext/gd/libgd/gd_gif_out.c Sat Jun 28 16:07:33 2003
@@ -0,0 +1,70 @@
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+#include <stdlib.h>
+#include "gd.h"
+
+/*
+** Wrapper functions for GIF output.
+*/
+
+void gdImageGifToSink(gdImagePtr im, gdSinkPtr outSink)
+{
+ gdIOCtx *out = gdNewSSCtx(NULL,outSink);
+ gdImageGifCtx(im, out);
+ out->gd_free(out);
+}
+
+void gdImageGifCtx(gdImagePtr im, gdIOCtx *out)
+{
+#ifdef LZW_LICENCED
+ gdImageLzwCtx(im, out);
+#else
+ gdImageBigGifCtx(im, out);
+#endif
+}
+
+void gdImageGif(gdImagePtr im, FILE *outFile)
+{
+#ifdef LZW_LICENCED
+ gdImageLzw(im, outFile);
+#else
+ gdImageBigGif(im, outFile);
+#endif
+}
+
+void* gdImageGifPtr(gdImagePtr im, int *size)
+{
+#ifdef LZW_LICENCED
+ return gdImageLzwPtr(im, size);
+#else
+ return gdImageBigGifPtr(im, size);
+#endif
+}
+
+void gdImageGifAnimAddCtx(gdImagePtr im, gdIOCtx *out, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal)
+{
+#ifdef LZW_LICENCED
+ gdImageLzwAnimAddCtx(im, out, LocalCM, LeftOfs, TopOfs, Delay, Disposal);
+#else
+ gdImageBigGifAnimAddCtx(im, out, LocalCM, LeftOfs, TopOfs, Delay, Disposal);
+#endif
+}
+
+void gdImageGifAnimAdd(gdImagePtr im, FILE *outFile, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal)
+{
+#ifdef LZW_LICENCED
+ gdImageLzwAnimAdd(im, outFile, LocalCM, LeftOfs, TopOfs, Delay, Disposal);
+#else
+ gdImageBigGifAnimAdd(im, outFile, LocalCM, LeftOfs, TopOfs, Delay, Disposal);
+#endif
+}
+
+void *gdImageGifAnimAddPtr(gdImagePtr im, int *size, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal)
+{
+#ifdef LZW_LICENCED
+ return gdImageLzwAnimAddPtr(im, size, LocalCM, LeftOfs, TopOfs, Delay, Disposal);
+#else
+ return gdImageBigGifAnimAddPtr(im, size, LocalCM, LeftOfs, TopOfs, Delay, Disposal);
+#endif
+}