summaryrefslogtreecommitdiff
path: root/graphics/py-gd/patches/patch-aa
blob: 09646c57d1afdd78e49f5306b42ddcba489fa781 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
$NetBSD: patch-aa,v 1.2 2005/12/19 16:01:34 joerg Exp $

--- gdmodule.c.orig	2005-12-19 15:53:23.000000000 +0000
+++ gdmodule.c
@@ -28,14 +28,13 @@ version 0.22
 #include <errno.h>
 
 static PyObject *ErrorObject;
-extern int errno;
 
 /* DOCSTRING */
 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 +83,7 @@ static imageobject *newimageobject();
 /*
 ** Methods for the image type
 */
-static PyObject *image_writegif(self, args)
+static PyObject *image_writepng(self, args)
 	imageobject *self;
 	PyObject *args;
 {
@@ -94,11 +93,11 @@ static PyObject *image_writegif(self, ar
 
 	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 +661,8 @@ static PyObject *image_getorigin(self)
 }
 
 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 +801,7 @@ static imageobject *newimageobject(args)
 		{
 			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 +813,7 @@ static imageobject *newimageobject(args)
 			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 +922,7 @@ static PyObject *gd_fontSSize(self, args
 
 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\