$NetBSD: patch-aa,v 1.1 1999/11/01 03:34:32 jlam Exp $ --- gdmodule.c.orig Sun Oct 31 20:13:48 1999 +++ gdmodule.c Sun Oct 31 20:14:43 1999 @@ -34,8 +34,8 @@ static char *gdModuleDocString = "GD module is an interface to the GD library written by Thomas Bouttel.\n\ \'It allows your code to quickly draw images complete with lines, arcs,\n\ text, multiple colors, cut and paste from other images, and flood fills,\n\ -and write out the result as a .GIF file. This is particularly useful in\n\ -World Wide Web applications, where .GIF is the format used for inline images.\'\n\ +and write out the result as a .PNG file. This is particularly useful in\n\ +World Wide Web applications, where .PNG is the format used for inline images.\'\n\ It has been extended in some ways from the original GD library."; /* @@ -84,7 +84,7 @@ /* ** Methods for the image type */ -static PyObject *image_writegif(self, args) +static PyObject *image_writepng(self, args) imageobject *self; PyObject *args; { @@ -94,11 +94,11 @@ if (PyArg_ParseTuple(args, "O!", &PyFile_Type, &fileobj)) { - gdImageGif(self->imagedata, PyFile_AsFile(fileobj)); + gdImagePng(self->imagedata, PyFile_AsFile(fileobj)); } else if (PyErr_Clear(), PyArg_ParseTuple(args, "z", &filename)) { - if (fp = fopen(filename, "wb")) gdImageGif(self->imagedata, fp); + if (fp = fopen(filename, "wb")) gdImagePng(self->imagedata, fp); else { PyErr_SetFromErrno(PyExc_IOError); @@ -662,8 +662,8 @@ } static struct PyMethodDef image_methods[] = { - {"writeGif", (PyCFunction)image_writegif, 1, "writeGif(f)\n\ - write the image to f as a GIF, where f is either an open file object or a\n\ + {"writePng", (PyCFunction)image_writepng, 1, "writePng(f)\n\ + write the image to f as a PNG, where f is either an open file object or a\n\ file name."}, {"writeGd", (PyCFunction)image_writegd, 1, "writeGd(f)\n\ write the image to f as a GD file, where f is either an open file object\n\ @@ -802,7 +802,7 @@ { if (!(ext = strrchr(filename,'.'))) { - PyErr_SetString(PyExc_IOError, "need an extension to determine file type (.gif|.gd|.xbm)"); + PyErr_SetString(PyExc_IOError, "need an extension to determine file type (.png|.gd|.xbm)"); Py_DECREF(self); return NULL; } @@ -814,7 +814,7 @@ Py_DECREF(self); return(NULL); } - if (!strcmp(ext,"gif") && (!(self->imagedata = gdImageCreateFromGif(fp)))) { + if (!strcmp(ext,"png") && (!(self->imagedata = gdImageCreateFromPng(fp)))) { fclose(fp); Py_DECREF(self); return(NULL); @@ -923,7 +923,7 @@ static struct PyMethodDef gd_methods[] = { {"image", gd_image, 1, "image(image[,(w,h)] | file | file,type | (w,h))\n\ -create GD image from file.(gif|gd|xbm), file,type (gif|gd|xbm),\n\ +create GD image from file.(png|gd|xbm), file,type (png|gd|xbm),\n\ the existing image, optionally resized to width w and height h\n\ or blank with width w and height h"}, {"fontstrsize", gd_fontSSize, 1, "fontstrsize(font, string)\n\