Anonymous avatar Anonymous committed 06e39b1

- sync to 2.0.21

Comments (0)

Files changed (13)

 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57 for GD 2.0.20.
+# Generated by GNU Autoconf 2.57 for GD 2.0.21.
 #
 # Report bugs to <gd@boutell.com>.
 #
 # Identity of this package.
 PACKAGE_NAME='GD'
 PACKAGE_TARNAME='gd'
-PACKAGE_VERSION='2.0.20'
-PACKAGE_STRING='GD 2.0.20'
+PACKAGE_VERSION='2.0.21'
+PACKAGE_STRING='GD 2.0.21'
 PACKAGE_BUGREPORT='gd@boutell.com'
 
 ac_unique_file="gd.c"
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures GD 2.0.20 to adapt to many kinds of systems.
+\`configure' configures GD 2.0.21 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of GD 2.0.20:";;
+     short | recursive ) echo "Configuration of GD 2.0.21:";;
    esac
   cat <<\_ACEOF
 
 test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
-GD configure 2.0.20
+GD configure 2.0.21
 generated by GNU Autoconf 2.57
 
 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by GD $as_me 2.0.20, which was
+It was created by GD $as_me 2.0.21, which was
 generated by GNU Autoconf 2.57.  Invocation command line was
 
   $ $0 $@
 
 GDLIB_MAJOR=2
 GDLIB_MINOR=0
-GDLIB_REVISION=20
+GDLIB_REVISION=21
 GDLIBNAME=gd
 
 
 
 # Define the identity of the package.
  PACKAGE=gd
- VERSION=2.0.20
+ VERSION=2.0.21
 
 
 cat >>confdefs.h <<_ACEOF
 } >&5
 cat >&5 <<_CSEOF
 
-This file was extended by GD $as_me 2.0.20, which was
+This file was extended by GD $as_me 2.0.21, which was
 generated by GNU Autoconf 2.57.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
 
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-GD config.status 2.0.20
+GD config.status 2.0.21
 configured by $0, generated by GNU Autoconf 2.57,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
 AC_PREREQ(2.54)
 
 #HEY! Change BOTH the vesion number and the GDLIB_REVISION setting!
-AC_INIT([GD], [2.0.20], [gd@boutell.com])
+AC_INIT([GD], [2.0.21], [gd@boutell.com])
 AC_CONFIG_SRCDIR([gd.c])
 AC_CONFIG_AUX_DIR(config)
 
 GDLIB_MAJOR=2
 GDLIB_MINOR=0
-GDLIB_REVISION=20
+GDLIB_REVISION=21
 GDLIBNAME=gd
 
 AC_SUBST(GDLIB_MAJOR)
 		      mapTo = gdImageGetTrueColorPixel (src, x, y);
 		      if (gdImageGetTransparent (src) == tmp)
 			{
-			  tox++;
+                          /* 2.0.21, TK: not tox++ */
+                          tox += stx[x - srcX];
 			  continue;
 			}
 		    }
 		      /* Added 7/24/95: support transparent copies */
 		      if (gdImageGetTransparent (src) == mapTo)
 			{
-			  tox++;
+                          /* 2.0.21, TK: not tox++ */
+                          tox += stx[x - srcX];
 			  continue;
 			}
 		    }
 	JPEG is always truecolor. */
    BGD_EXPORT gdImagePtr gdImageCreateFromPng (FILE * fd);
    BGD_EXPORT gdImagePtr gdImageCreateFromPngCtx (gdIOCtxPtr in);
+   BGD_EXPORT gdImagePtr gdImageCreateFromPngPtr (int size, void *data);
    BGD_EXPORT gdImagePtr gdImageCreateFromWBMP (FILE * inFile);
    BGD_EXPORT gdImagePtr gdImageCreateFromWBMPCtx (gdIOCtx * infile);
+   BGD_EXPORT gdImagePtr gdImageCreateFromWBMPPtr (int size, void *data);
    BGD_EXPORT gdImagePtr gdImageCreateFromJpeg (FILE * infile);
    BGD_EXPORT gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile);
+   BGD_EXPORT gdImagePtr gdImageCreateFromJpegPtr (int size, void *data);
 
 /* A custom data source. */
 /* The source function must return -1 on error, otherwise the number
   }
   gdSource, *gdSourcePtr;
 
+   /* Deprecated in favor of gdImageCreateFromPngCtx */
    BGD_EXPORT gdImagePtr gdImageCreateFromPngSource (gdSourcePtr in);
 
    BGD_EXPORT gdImagePtr gdImageCreateFromGd (FILE * in);
    BGD_EXPORT gdImagePtr gdImageCreateFromGdCtx (gdIOCtxPtr in);
+   BGD_EXPORT gdImagePtr gdImageCreateFromGdPtr (int size, void *data);
 
    BGD_EXPORT gdImagePtr gdImageCreateFromGd2 (FILE * in);
    BGD_EXPORT gdImagePtr gdImageCreateFromGd2Ctx (gdIOCtxPtr in);
+   BGD_EXPORT gdImagePtr gdImageCreateFromGd2Ptr (int size, void *data);
 
    BGD_EXPORT gdImagePtr gdImageCreateFromGd2Part (FILE * in, int srcx, int srcy, int w,
 				       int h);
    BGD_EXPORT gdImagePtr gdImageCreateFromGd2PartCtx (gdIOCtxPtr in, int srcx, int srcy,
 					  int w, int h);
+   BGD_EXPORT gdImagePtr gdImageCreateFromGd2PartPtr (int size, void *data, int srcx, int srcy,
+					  int w, int h);
   /* 2.0.10: prototype was missing */
-   BGD_EXPORT gdImagePtr gdImageCreateFromXpm (char *filename);
    BGD_EXPORT gdImagePtr gdImageCreateFromXbm (FILE * in);
 
+  /* NOTE: filename, not FILE */
+   BGD_EXPORT gdImagePtr gdImageCreateFromXpm (char *filename);
+
    BGD_EXPORT void gdImageDestroy (gdImagePtr im);
 
 /* Replaces or blends with the background depending on the
 /* I/O Support routines. */
 
   BGD_EXPORT gdIOCtx *gdNewFileCtx (FILE *);
-  BGD_EXPORT gdIOCtx *gdNewDynamicCtx (int, void *);
+  /* If data is null, size is ignored and an initial data buffer is
+    allocated automatically. NOTE: this function assumes gd has the right 
+    to free or reallocate "data" at will! Also note that gd will free 
+    "data" when the IO context is freed. If data is not null, it must point
+    to memory allocated with gdMalloc, or by a call to gdImage[something]Ptr.
+    If not, see gdNewDynamicCtxEx for an alternative. */
+  BGD_EXPORT gdIOCtx *gdNewDynamicCtx (int size, void *data);
+  /* 2.0.21: if freeFlag is nonzero, gd will free and/or reallocate "data" as
+    needed as described above. If freeFlag is zero, gd will never free 
+    or reallocate "data," which means that the context should only be used
+    for *reading* an image from a memory buffer, or writing an image to a
+    memory buffer which is already large enough. If the memory buffer is
+    not large enough and an image write is attempted, the write operation
+    will fail. Those wishing to write an image to a buffer in memory have
+    a much simpler alternative in the gdImage[something]Ptr functions. */
+  BGD_EXPORT gdIOCtx *gdNewDynamicCtxEx (int size, void *data, int freeFlag);
   BGD_EXPORT gdIOCtx *gdNewSSCtx (gdSourcePtr in, gdSinkPtr out);
   BGD_EXPORT void *gdDPExtractData (struct gdIOCtx *ctx, int *size);
 
 }
 
 gdImagePtr
+gdImageCreateFromGdPtr (int size, void *data)
+{
+  gdImagePtr im;
+  gdIOCtx *in = gdNewDynamicCtxEx (size, data, 0);
+  im = gdImageCreateFromGdCtx (in);
+  in->gd_free (in);
+  return im;
+}
+
+gdImagePtr
 gdImageCreateFromGdCtx (gdIOCtxPtr in)
 {
   int sx, sy;
 }
 
 gdImagePtr
+gdImageCreateFromGd2Ptr (int size, void *data)
+{
+  gdImagePtr im;
+  gdIOCtx *in = gdNewDynamicCtxEx (size, data, 0);
+  im = gdImageCreateFromGd2Ctx (in);
+  in->gd_free (in);
+  return im;
+}
+
+gdImagePtr
 gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
 {
   int sx, sy;
 }
 
 gdImagePtr
+gdImageCreateFromGd2PartPtr (int size, void *data, int srcx, int srcy, int w, int h)
+{
+  gdImagePtr im;
+  gdIOCtx *in = gdNewDynamicCtxEx (size, data, 0);
+  im = gdImageCreateFromGd2PartCtx (in, srcx, srcy, w, h);
+  in->gd_free (in);
+  return im;
+}
+
+gdImagePtr
 gdImageCreateFromGd2PartCtx (gdIOCtx * in, int srcx, int srcy, int w, int h)
 {
   int scx, scy, ecx, ecy, fsx, fsy;
   int realSize;
   int dataGood;
   int pos;
+  int freeOK;
 }
 dynamicPtr;
 
 static int gdReallocDynamic (dynamicPtr * dp, int required);
 static int trimDynamic (dynamicPtr * dp);
 static void gdFreeDynamicCtx (struct gdIOCtx *ctx);
-static dynamicPtr *newDynamic (int initialSize, void *data);
+static dynamicPtr *newDynamic (int initialSize, void *data, int freeOKFlag);
 
 static int dynamicPutbuf (struct gdIOCtx *, const void *, int);
 static void dynamicPutchar (struct gdIOCtx *, int a);
 gdIOCtx *
 gdNewDynamicCtx (int initialSize, void *data)
 {
+  gdNewDynamicCtxEx(initialSize, data, 1);
+}
+
+gdIOCtx *
+gdNewDynamicCtxEx (int initialSize, void *data, int freeOKFlag)
+{
   dpIOCtx *ctx;
   dynamicPtr *dp;
 
       return NULL;
     }
 
-  dp = newDynamic (initialSize, data);
+  dp = newDynamic (initialSize, data, freeOKFlag);
   if (!dp)
     {
       gdFree (ctx);
     {
       *size = 0;
       data = NULL;
-      if (dp->data != NULL)
+      /* 2.0.21: never free memory we don't own */
+      if ((dp->data != NULL) && (dp->freeOK))
 	{
 	  gdFree (dp->data);
 	}
   gdFree (ctx);
 
   /* clean up the data block and return it */
-  if (dp->data != NULL)
+  /* 2.0.21: never free memory we don't own */
+  if ((dp->data != NULL) && (dp->freeOK))
     {
       gdFree (dp->data);
       dp->data = NULL;
   bytesNeeded = pos;
   if (bytesNeeded > dp->realSize)
     {
+      /* 2.0.21 */
+      if (!dp->freeOK) {
+        return FALSE;
+      }
       if (!gdReallocDynamic (dp, dp->realSize * 2))
 	{
 	  dp->dataGood = FALSE;
 
 /* return data as a dynamic pointer */
 static dynamicPtr *
-newDynamic (int initialSize, void *data)
+newDynamic (int initialSize, void *data, int freeOKFlag)
 {
   dynamicPtr *dp;
   dp = (dynamicPtr *) gdMalloc (sizeof (dynamicPtr));
     return NULL;
 
   dp->pos = 0;
-
+  dp->freeOK = freeOKFlag;
   return dp;
 }
 
 
   if (bytesNeeded > dp->realSize)
     {
+      /* 2.0.21 */
+      if (!dp->freeOK) {
+        return FALSE;
+      }
       if (!gdReallocDynamic (dp, bytesNeeded * 2))
 	{
 	  dp->dataGood = FALSE;
 static int
 trimDynamic (dynamicPtr * dp)
 {
+  /* 2.0.21: we don't reallocate memory we don't own */
+  if (!dp->freeOK) {
+    return TRUE;
+  }
   return gdReallocDynamic (dp, dp->logicalSize);
 }
   return im;
 }
 
+gdImagePtr
+gdImageCreateFromJpegPtr (int size, void *data)
+{
+  gdImagePtr im;
+  gdIOCtx *in = gdNewDynamicCtxEx (size, data, 0);
+  im = gdImageCreateFromJpegCtx (in);
+  in->gd_free (in);
+  return im;
+}
+
 void jpeg_gdIOCtx_src (j_decompress_ptr cinfo, gdIOCtx * infile);
 
 /* 
   return im;
 }
 
+gdImagePtr
+gdImageCreateFromPngPtr (int size, void *data)
+{
+  gdImagePtr im;
+  gdIOCtx *in = gdNewDynamicCtxEx (size, data, 0);
+  im = gdImageCreateFromPngCtx (in);
+  in->gd_free (in);
+  return im;
+}
 
 /* This routine is based in part on the Chapter 13 demo code in "PNG: The
  *  Definitive Guide" (http://www.cdrom.com/pub/png/pngbook.html).
   return (im);
 }
 
+gdImagePtr
+gdImageCreateFromWBMPPtr (int size, void *data)
+{
+  gdImagePtr im;
+  gdIOCtx *in = gdNewDynamicCtxEx (size, data, 0);
+  im = gdImageCreateFromWBMPCtx (in);
+  in->gd_free (in);
+  return im;
+}
+
 /* gdImageWBMP
    ** -----------
  */
       encoding = charmap->encoding_id;
 
 /* EAM DEBUG - Newer versions of libfree2 make it easier by defining encodings */
-#ifdef FT_ENCODING_MS_SYMBOL
+#if (defined(FREETYPE_MAJOR) && (FREETYPE_MAJOR >=2 ) && (FREETYPE_MINOR >= 1))
       if (charmap->encoding == FT_ENCODING_MS_SYMBOL
       ||  charmap->encoding == FT_ENCODING_ADOBE_CUSTOM
       ||  charmap->encoding == FT_ENCODING_ADOBE_STANDARD) {
 	a->face->charmap = charmap;
 	return (void *)a;
       }
-#endif /* FT_ENCODING_MS_SYMBOL */
+#endif /* Freetype 2.1 or better */
 /* EAM DEBUG */
 
       if ((platform == 3 && encoding == 1)	/* Windows Unicode */
 	}
 
 /* EAM DEBUG */
-#ifdef FT_ENCODING_MS_SYMBOL
+#if (defined(FREETYPE_MAJOR) && (FREETYPE_MAJOR >=2 ) && (FREETYPE_MINOR >= 1))
       if (font->face->charmap->encoding == FT_ENCODING_MS_SYMBOL)
 	{
          /* I do not know the significance of the constant 0xf000. */
            ch |= 0xf000;
            next += len;
 	} else
-#endif /* FT_ENCODING_MS_SYMBOL */
+#endif /* Freetype 2.1 or better */
 /* EAM DEBUG */
 	
       switch (m)
   FILE *in, *out;
   void *iptr;
   int sz;
-  gdIOCtxPtr ctx;
   char of[256];
   int colRed, colBlu;
   gdSource imgsrc;
   unlink (of);
   gdImageDestroy (im2);
 
+  /* 2.0.21: use the new From*Ptr functions */
   iptr = gdImagePngPtr (im, &sz);
-  ctx = gdNewDynamicCtx (sz, iptr);
-  im2 = gdImageCreateFromPngCtx (ctx);
-
+  im2 = gdImageCreateFromPngPtr (sz, iptr);
+  gdFree(iptr);
   CompareImages ("GD->PNG ptr->GD", ref, im2);
 
   gdImageDestroy (im2);
-  ctx->gd_free (ctx);
-
 
   /* */
   /* Send to GD2 File then Ptr */
 
   iptr = gdImageGd2Ptr (im, 128, 2, &sz);
   /*printf("Got ptr %d (size %d)\n",iptr, sz); */
-  ctx = gdNewDynamicCtx (sz, iptr);
-  /*printf("Got ctx %d\n",ctx); */
-  im2 = gdImageCreateFromGd2Ctx (ctx);
+  im2 = gdImageCreateFromGd2Ptr (sz, iptr);
+  gdFree(iptr);
   /*printf("Got img2 %d\n",im2); */
 
   CompareImages ("GD->GD2 ptr->GD", ref, im2);
 
   gdImageDestroy (im2);
-  ctx->gd_free (ctx);
-
 
   /* */
   /* Send to GD File then Ptr */
 
   iptr = gdImageGdPtr (im, &sz);
   /*printf("Got ptr %d (size %d)\n",iptr, sz); */
-  ctx = gdNewDynamicCtx (sz, iptr);
-  /*printf("Got ctx %d\n",ctx); */
-  im2 = gdImageCreateFromGdCtx (ctx);
+  im2 = gdImageCreateFromGdPtr (sz, iptr);
+  gdFree(iptr);
   /*printf("Got img2 %d\n",im2); */
 
   CompareImages ("GD->GD ptr->GD", ref, im2);
 
   gdImageDestroy (im2);
-  ctx->gd_free (ctx);
 
   /*
      ** Test gdImageCreateFromPngSource'
 <!-- REMEMBER TO EDIT index.html.source -->
 <head>
-<TITLE>gd 2.0.20</TITLE>
+<TITLE>gd 2.0.21</TITLE>
 </head>
 <body bgcolor="#FFFFFF">
 <!-- BANNER HERE -->
-<H2>gd 2.0.20</H2>
+<H2>gd 2.0.21</H2>
 <H3>A graphics library for fast image creation</H3>
 <H3>Follow this link to the
 <A HREF="http://www.boutell.com/gd/">latest version
 new installation overwrites the old.
 <p>
 <strong>ABOUT GD AND GIF:</strong>
-gd 2.0.20 creates PNG, JPEG and WBMP images, not GIF images. This is a 
+gd 2.0.21 creates PNG, JPEG and WBMP images, not GIF images. This is a 
 good thing.  PNG is a more compact format, and full compression is
 available.  JPEG works best with photographic images, and is still
 more compatible with the major Web browsers than even PNG is. WBMP is
 modern image formats such as PNG and JPEG as soon as possible.
 
 <p>
-When building from soruce, gd 2.0.20 <strong>requires</strong> that the 
+When building from soruce, gd 2.0.21 <strong>requires</strong> that the 
 following libraries also be installed, in order to produce the related 
 image formats. The win32 binary release (bgd) already contains the
 appropriate libraries.
 <H3>Table of Contents</H3>
 <UL>
 <LI><A HREF="#notice">Credits and license terms</A>
-<LI><A HREF="#whatsnew2.0.20">What's new in version "XYZ" of GD?</A>
+<LI><A HREF="#whatsnew2.0.21">What's new in version "XYZ" of GD?</A>
 <LI><A HREF="#whatis">What is gd?</A>
 <LI><A HREF="#gdother">What if I want to use another programming language?</A>
 <LI><A HREF="#required">What else do I need to use gd?</A>
 <A NAME="gdother"><H3>What if I want to use another programming
 language?</h3></A>
 Not all of these tools are necessarily up to date and fully compatible
-with 2.0.20.
+with 2.0.21.
 <h4>PHP</h4>
 A variant of gd 2.x is included in PHP 4.3.0. It is also possible
-to patch PHP 4.2.3 for use with gd 2.0.20; see the
+to patch PHP 4.2.3 for use with gd 2.0.21; see the
 <a href="http://www.boutell.com/gd/">gd home page</a> for a link to
 that information. It would be a Good Idea to merge all of the things
 that are better in mainstream gd and all of the things that are
 <li><a href="http://martin.gleeson.com/fly/">fly</a>, by Martin Gleeson
 </ul>
 <P>
+<A NAME="whatsnew2.0.21"><H3>What's new in version 2.0.21?</H3></A>
+<P>
+<ul>
+<li>Version 2.0.21 adds a <code>gdImageCreateFrom*Ptr</code> family
+of functions which make it convenient to load an image in any
+GD-supported format directly from memory.
+<li>The new <code>gdNewDynamicCtxEx</code> function was added to
+support the easy implementation of the above functions and to
+correct a design problem which made life unpleasant for those passing
+in memory not originally allocated by gd to the 
+<code>gdNewDynamicCtx</code> function by provoding a way to specify
+that gd should never free or reallocate a particular block of memory.
+The <code>gdNewDynamicCtx</code> function and its relatives, although
+still exported for ABI compatibility, are now <b>deprecated</b> except 
+for internal use, in favor of <a href="#gdImageCreateFromPngPtr"><code>gdImageCreateFromPngPtr</code></a>
+and its relatives.
+<li>Version 2.0.21 includes a new patch from Ethan A. Merritt to
+correct a bug in the conditional compilation of support for
+symbol fonts in gdft.c. Symbol fonts should now work correctly.
+Thanks to Mr. Merritt.
+<li>Version 2.0.20 restores the <code>gdFreeFontCache</code> function,
+an undocumented function added in an earlier release which now simply
+calls <code>gdFontCacheShutdown</code> for backwards compatibility.
+This repairs build problems when compiling PHP against the latest gd.
+<li>Documentation improvements.
+</ul>
+<P>
 <A NAME="whatsnew2.0.20"><H3>What's new in version 2.0.20?</H3></A>
 <P>
 <ul>
 </ul>
 <h4>Source Code:</h4>
 <ul>
-<li><a href="http://www.boutell.com/gd/http/gd-2.0.20.tar.gz">Gzipped Tar File (Unix)</a>
-<li><a href="http://www.boutell.com/gd/http/gd-2.0.20.zip">.ZIP File of SOURCE CODE (Windows)</a>
+<li><a href="http://www.boutell.com/gd/http/gd-2.0.21.tar.gz">Gzipped Tar File (Unix)</a>
+<li><a href="http://www.boutell.com/gd/http/gd-2.0.21.zip">.ZIP File of SOURCE CODE (Windows)</a>
 </ul>
 <P>
 <A NAME="buildgd"><H3>How do I build gd?</H3></A>
 consult with an experienced user of your system. Sorry, we cannot
 answer questions about basic Internet skills.
 <p>
-Unpacking the archive will produce a directory called "gd-2.0.20".
+Unpacking the archive will produce a directory called "gd-2.0.21".
 <p>
 <h4>For Unix</h4>
-<code>cd</code> to the 2.0.20 directory and type:
+<code>cd</code> to the 2.0.21 directory and type:
 <p>
 <code>./configure</code>
 <P>
 <DT><A NAME="gdImageCreateFromJpeg">gdImageCreateFromJpeg(FILE *in)</A>
 <strong>(FUNCTION)</strong>
 <br>
+<A NAME="gdImageCreateFromJpegPtr">gdImageCreateFromJpegPtr(int size, void *data)</A>
+<strong>(FUNCTION)</strong>
+<br>
 <A NAME="gdImageCreateFromJpegCtx">gdImageCreateFromJpegCtx(gdIOCtx *in)</A>
 <strong>(FUNCTION)</strong>
 <p>
 image to determine its size. The image must eventually be destroyed
 using <A HREF="#gdImageDestroy">gdImageDestroy()</A>. <strong>The
 returned image is always a truecolor image.</strong> 
+<p>
+If you already have the
+image file in memory, pass the size of the file and a pointer to the
+file's data to gdImageCreateFromJpegPtr, which is otherwise identical
+to gdImageCreateFromJpeg.
+<p>
 <PRE>
 <A HREF="#gdImagePtr">gdImagePtr</A> im;
 ... inside a function ...
 </PRE>
 <DT><A NAME="gdImageCreateFromPng">gdImageCreateFromPng(FILE *in)</A>
 <strong>(FUNCTION)</strong>
+<BR><A NAME="gdImageCreateFromPngPtr">gdImageCreateFromPngPtr(int size, void *data)</A>
+<strong>(FUNCTION)</strong>
 <BR><A NAME="gdImageCreateFromPngCtx">gdImageCreateFromPngCtx(<a href=#gdioctx>gdIOCtx</a> *in)</A>
 <strong>(FUNCTION)</strong>
 <p>
 image to determine its size. The image must eventually be destroyed
 using <A HREF="#gdImageDestroy">gdImageDestroy()</A>.
 <p>
+If you already have the
+image file in memory, pass the size of the file and a pointer to the
+file's data to gdImageCreateFromPngPtr, which is otherwise identical
+to gdImageCreateFromPng.
+<p>
 If the PNG image being loaded is a truecolor image, the resulting
 gdImagePtr will refer to a truecolor image. If the PNG image
 being loaded is a palette or grayscale image, the resulting
 <DT><A NAME="gdImageCreateFromPngSource">gdImageCreateFromPngSource(gdSourcePtr in)</A>
 <strong>(FUNCTION)</strong>
 <dd>
+<b>Deprecated</b> in favor of
+<a href="#gdImageCreateFromPngCtx">gdImageCreateFromPngCtx</a>. Should
+not be used in new applications.
+<p>
 gdImageCreateFromPngSource is called to load a PNG from
 a data source other than a file. Usage is very similar to
 the <a href="#gdImageCreateFromPng">gdImageCreateFromPng</a> function,
 </pre>
 <DT><A NAME="gdImageCreateFromGd">gdImageCreateFromGd(FILE *in)</A>
 <strong>(FUNCTION)</strong>
+<br><DT><A NAME="gdImageCreateFromGdPtr">gdImageCreateFromGdPtr(int size, void *data)</A>
+<strong>(FUNCTION)</strong>
 <BR><A NAME="gdImageCreateFromGdCtx">gdImageCreateFromGdCtx(<a href=#gdioctx>gdIOCtx</a> *in)</A>
 <strong>(FUNCTION)</strong>
 <p>
 in the <A HREF="#gdformat">gd file format</A>, which is specific to
 gd and intended for very fast loading. (It is <em>not</em> intended for
 compression; for compression, use PNG or JPEG.)
+<p>
+If you already have the
+image file in memory, pass the size of the file and a pointer to the
+file's data to gdImageCreateFromGdPtr, which is otherwise identical
+to gdImageCreateFromGd.
+<p>
 gdImageCreateFromGd
 returns a <A HREF="#gdImagePtr">gdImagePtr</A> to the new image, or NULL
 if unable to load the image (most often because the file is corrupt or
 
 <DT><A NAME="gdImageCreateFromGd2">gdImageCreateFromGd2(FILE *in)</A>
 <strong>(FUNCTION)</strong>
+<br><A NAME="gdImageCreateFromGd2Ptr">gdImageCreateFromGd2Ptr(int size, void *data)</A>
+<strong>(FUNCTION)</strong>
 <BR><A NAME="gdImageCreateFromGd2Ctx">gdImageCreateFromGd2Ctx(<a href=#gdioctx>gdIOCtx</a> *in)</A>
 <strong>(FUNCTION)</strong>
 <p>
 Invoke gdImageCreateFromGd2
 with an already opened pointer to a file containing the desired image
 in the <A HREF="#gdformat">gd2 file format</A>, which is specific to
-gd2 and intended for fast loading of parts of large images.
+gd2 and intended for fast loading of parts of large images. 
 (It is a compressed format, but generally not as good as maximum
-compression of the entire image would be.)
-gdImageCreateFromGd
+compression of the entire image would be.) 
+<p>
+If you already have the
+image file in memory, pass the size of the file and a pointer to the
+file's data to gdImageCreateFromGd2Ptr, which is otherwise identical
+to gdImageCreateFromGd2.
+<p>
+gdImageCreateFromGd2
 returns a <A HREF="#gdImagePtr">gdImagePtr</A> to the new image, or NULL
 if unable to load the image (most often because the file is corrupt or
 does not contain a gd format image). gdImageCreateFromGd2 does <em>not</em>
 
 <DT><A NAME="gdImageCreateFromGd2Part">gdImageCreateFromGd2Part(FILE *in, int srcX, int srcY, int w, int h)</A>
 <strong>(FUNCTION)</strong>
+<br><A NAME="gdImageCreateFromGd2PartPtr">gdImageCreateFromGd2PartPtr(int size, void *data, int srcX, int srcY, int w, int h)</A>
+<strong>(FUNCTION)</strong>
 <BR><A NAME="gdImageCreateFromGd2PartCtx">gdImageCreateFromGd2PartCtx(<a href=#gdioctx>gdIOCtx</a> *in)</A>
 <strong>(FUNCTION)</strong>
 <p>
 new image, or NULL if unable to load the image.
 The image must eventually be destroyed using <A HREF="#gdImageDestroy">gdImageDestroy()</A>.
 <p>
+If you already have the image file in memory, you may use
+gdImageCreateFromGd2PartPtr. Pass the size of the image file,
+in bytes, as the first argument and the pointer to the image file data
+as the second argument.
+<p>
+<DT><A NAME="gdImageCreateFromWBMP">gdImageCreateFromWBMP(FILE *in)</A>
+<strong>(FUNCTION)</strong>
+<BR><A NAME="gdImageCreateFromWBMPPtr">gdImageCreateFromWBMPPtr(int size, void *data)</A>
+<strong>(FUNCTION)</strong>
+<BR><A NAME="gdImageCreateFromWBMPCtx">gdImageCreateFromWBMPCtx(<a href=#gdioctx>gdIOCtx</a> *in)</A>
+<strong>(FUNCTION)</strong>
+<p>
+<DD>
+gdImageCreateFromWBMP is called to load images from WBMP format files.
+Invoke gdImageCreateFromWBMP with an already opened pointer to a file
+containing the desired image.
+gdImageCreateFromWBMP
+returns a <A HREF="#gdImagePtr">gdImagePtr</A> to the new image, or NULL
+if unable to load the image (most often because the file is corrupt or
+does not contain a PNG image). gdImageCreateFromWBMP does <em>not</em>
+close the file. You can inspect the sx and sy members of the
+image to determine its size. The image must eventually be destroyed
+using <A HREF="#gdImageDestroy">gdImageDestroy()</A>.
+<p>
+If you already have the
+image file in memory, pass the size of the file and a pointer to the
+file's data to gdImageCreateFromWBMPPtr, which is otherwise identical
+to gdImageCreateFromWBMP.
+<PRE>
+<A HREF="#gdImagePtr">gdImagePtr</A> im;
+... inside a function ...
+FILE *in;
+in = fopen("mywbmp.wbmp", "rb");
+im = gdImageCreateFromWBMP(in);
+fclose(in);
+/* ... Use the image ... */
+<A HREF="#gdImageDestroy">gdImageDestroy</A>(im);
+</PRE>
+<p>
 <DT><A NAME="gdImageCreateFromXbm">gdImageCreateFromXbm(FILE *in)</A>
 <strong>(FUNCTION)</strong>
 <DD>
 <A HREF="#gdImageCreate">gdImageCreatePalette</A> |
 <A HREF="#gdImageCreate">gdImageCreateTrueColor</A> |
 <A HREF="#gdImageCreateFromGd">gdImageCreateFromGd</A> |
+<A HREF="#gdImageCreateFromGdCtx">gdImageCreateFromGdCtx</A> |
+<A HREF="#gdImageCreateFromGdPtr">gdImageCreateFromGdPtr</A> |
 <A HREF="#gdImageCreateFromGd2">gdImageCreateFromGd2</A> |
 <A HREF="#gdImageCreateFromGd2Ctx">gdImageCreateFromGd2Ctx</A> |
+<A HREF="#gdImageCreateFromGd2Ptr">gdImageCreateFromGd2Ptr</A> |
 <A HREF="#gdImageCreateFromGd2Part">gdImageCreateFromGd2Part</A> |
 <A HREF="#gdImageCreateFromGd2PartCtx">gdImageCreateFromGd2PartCtx</A> |
+<A HREF="#gdImageCreateFromGd2PartPtr">gdImageCreateFromGd2PartPtr</A> |
 <A HREF="#gdImageCreateFromJpeg">gdImageCreateFromJpeg</A> |
 <A HREF="#gdImageCreateFromJpegCtx">gdImageCreateFromJpegCtx</A> |
+<A HREF="#gdImageCreateFromJpegPtr">gdImageCreateFromJpegPtr</A> |
 <A HREF="#gdImageCreateFromPng">gdImageCreateFromPng</A> |
 <A HREF="#gdImageCreateFromPngCtx">gdImageCreateFromPngCtx</A> |
+<A HREF="#gdImageCreateFromPngPtr">gdImageCreateFromPngPtr</A> |
 <A HREF="#gdImageCreateFromPngSource">gdImageCreateFromPngSource</A> |
+<A HREF="#gdImageCreateFromWBMP">gdImageCreateFromWBMP</A> |
+<A HREF="#gdImageCreateFromWBMPCtx">gdImageCreateFromWBMPCtx</A> |
+<A HREF="#gdImageCreateFromWBMPPtr">gdImageCreateFromWBMPPtr</A> |
 <A HREF="#gdImageCreateFromXbm">gdImageCreateFromXbm</A> |
 <A HREF="#gdImageCreateFromXpm">gdImageCreateFromXpm</A> |
 <A HREF="#gdImageDashedLine">gdImageDashedLine</A> |
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.