cvs: gd /libgd/src CMakeLists.txt gdpp.cxx gdpp.h

[email protected] ("Pierre-Alain Joye") Tue, 15 Jan 2008 21:47:49 -0000
Newsgroups php.gd.cvs
Message-ID <cvspajoye1200433669@cvsserver>
pajoye		Tue Jan 15 21:47:49 2008 UTC

  Modified files:              
    /gd/libgd/src	CMakeLists.txt gdpp.cxx gdpp.h 
  Log:
  - add the c++ binding to the build
  - don't try to compile jpeg/png if the format is not enabled
  
http://cvs.php.net/viewvc.cgi/gd/libgd/src/CMakeLists.txt?r1=1.13&r2=1.14&diff_format=u
Index: gd/libgd/src/CMakeLists.txt
diff -u gd/libgd/src/CMakeLists.txt:1.13 gd/libgd/src/CMakeLists.txt:1.14
--- gd/libgd/src/CMakeLists.txt:1.13	Mon Dec 31 00:58:38 2007
+++ gd/libgd/src/CMakeLists.txt	Tue Jan 15 21:47:49 2008
@@ -2,12 +2,18 @@
 SET (LIBGD_SRC_FILES
 	gd.c
 	gdfx.c
+	gdfx.h
 	gd_crop.c
 	gd_transform.c
 	gd_security.c
+	gdpp.cxx
+	gdpp.h
 	gd_gd.c
 	gd_gd2.c
 	gd_io.c
+	gd_io.h
+	gd_io_stream.cxx
+	gd_io_stream.h
 	gd_io_dp.c
 	gd_gif_in.c
 	gd_gif_out.c
@@ -15,18 +21,26 @@
 	gd_io_ss.c
 	gd_jpeg.c
 	gd_nnquant.c
+	gd_nnquant.h
 	gd_png.c
 	gd_tiff.c
 	gd_tga.c
+	gd_tga.h
 	gd_ss.c
 	gd_topal.c
 	gd_wbmp.c
 	gdcache.c
+	gdcache.h
 	gdfontg.c
+	gdfontg.h
 	gdfontl.c
+	gdfontl.h
 	gdfontmb.c
+	gdfontmb.h
 	gdfonts.c
+	gdfonts.h
 	gdfontt.c
+	gdfontt.h
 	gdft.c
 	gdhelpers.c
 	gdhelpers.h
@@ -35,6 +49,7 @@
 	gdxpm.c
 	jisx0208.h
 	wbmp.c
+	gd.h
 	wbmp.h
 )
 
http://cvs.php.net/viewvc.cgi/gd/libgd/src/gdpp.cxx?r1=1.1&r2=1.2&diff_format=u
Index: gd/libgd/src/gdpp.cxx
diff -u gd/libgd/src/gdpp.cxx:1.1 gd/libgd/src/gdpp.cxx:1.2
--- gd/libgd/src/gdpp.cxx:1.1	Tue Dec 11 18:58:15 2007
+++ gd/libgd/src/gdpp.cxx	Tue Jan 15 21:47:49 2008
@@ -1,5 +1,5 @@
 /* *****************************************************************************
-** $Id: gdpp.cxx,v 1.1 2007/12/11 18:58:15 kshepherd Exp $
+** $Id: gdpp.cxx,v 1.2 2008/01/15 21:47:49 pajoye Exp $
 ** Initial file written and documented by:
 ** Kevin Shepherd <[email protected]> December 2007
 ** of Scarlet Line http://www.scarletline.com/
@@ -40,15 +40,18 @@
 		   0x89 0x50 0x4E 0x47 0x0D 0x0A 0x1A 0x0A
 		   == .PNG\r\n.\n
 		*/
+#if HAVE_PNG
 		case 0x89: // PNG
 			rtn = CreateFromPng(in);
 			break;
+#endif
 		/* GIF
 			0x47 0x49 0x46
 		*/
 		case 0x47: // GIF
 			rtn = CreateFromGif(in);
 			break;
+#if HAVE_JPEG
 		/* JPEG
 		A JFIF-standard file will start with the four bytes (hex) FF D8 FF E0,
 		    followed by two variable bytes (often hex 00 10), followed by 'JFIF'.		
@@ -56,6 +59,7 @@
 		case 0xFF: // JPEG
 			rtn = CreateFromJpeg(in);
 			break;
+#endif
 		/* WBMP
 		WBMP Type 0: B/W, Uncompressed bitmap is the only gd supported type		
 		*/
@@ -118,6 +122,7 @@
 		bool rtn;
 		switch (in.peek())
 			{
+#if HAVE_PNG
 		/* PNG
 		The first eight bytes of a PNG file always contain the following (decimal) values:
 		   0x89 0x50 0x4E 0x47 0x0D 0x0A 0x1A 0x0A
@@ -126,12 +131,16 @@
 		case 0x89: // PNG
 			rtn = CreateFromPng(in);
 			break;
+#endif
+
 		/* GIF
 			0x47 0x49 0x46
 		*/
 		case 0x47: // GIF
 			rtn = CreateFromGif(in);
 			break;
+
+#if HAVE_JPEG
 		/* JPEG
 		A JFIF-standard file will start with the four bytes (hex) FF D8 FF E0,
 		    followed by two variable bytes (often hex 00 10), followed by 'JFIF'.		
@@ -139,6 +148,8 @@
 		case 0xFF: // JPEG
 			rtn = CreateFromJpeg(in);
 			break;
+#endif
+
 		/* WBMP
 		WBMP Type 0: B/W, Uncompressed bitmap is the only gd supported type		
 		*/
@@ -181,6 +192,8 @@
 		bool rtn;
 		switch (((unsigned char * )data)[0])
 			{
+
+#if HAVE_PNG
 		/* PNG
 		The first eight bytes of a PNG file always contain the following (decimal) values:
 		   0x89 0x50 0x4E 0x47 0x0D 0x0A 0x1A 0x0A
@@ -189,12 +202,15 @@
 		case 0x89: // PNG
 			rtn = CreateFromPng(size, data);
 			break;
+#endif
 		/* GIF
 			0x47 0x49 0x46
 		*/
 		case 0x47: // GIF
 			rtn = CreateFromGif(size, data);
 			break;
+
+#if HAVE_JPEG
 		/* JPEG
 		A JFIF-standard file will start with the four bytes (hex) FF D8 FF E0,
 		    followed by two variable bytes (often hex 00 10), followed by 'JFIF'.		
@@ -202,6 +218,8 @@
 		case 0xFF: // JPEG
 			rtn = CreateFromJpeg(size, data);
 			break;
+#endif
+
 		/* WBMP
 		WBMP Type 0: B/W, Uncompressed bitmap is the only gd supported type		
 		*/
http://cvs.php.net/viewvc.cgi/gd/libgd/src/gdpp.h?r1=1.2&r2=1.3&diff_format=u
Index: gd/libgd/src/gdpp.h
diff -u gd/libgd/src/gdpp.h:1.2 gd/libgd/src/gdpp.h:1.3
--- gd/libgd/src/gdpp.h:1.2	Sun Dec 16 21:31:27 2007
+++ gd/libgd/src/gdpp.h	Tue Jan 15 21:47:49 2008
@@ -1,5 +1,5 @@
 /* *****************************************************************************
-** $Id: gdpp.h,v 1.2 2007/12/16 21:31:27 kshepherd Exp $
+** $Id: gdpp.h,v 1.3 2008/01/15 21:47:49 pajoye Exp $
 ** Initial file written and documented by:
 ** Kevin Shepherd <[email protected]> December 2007
 ** of Scarlet Line http://www.scarletline.com/
@@ -262,7 +262,7 @@
 		*/
 		Image(int size, void * data) 
 		:im(0) { CreateFrom(size, data); }
-		
+#if HAVE_PNG
 		/** Construct an image by reading from \p in.
 			The tag is an empty struct which simply tells the compiler which image read function to use.
 			e.g. GD::Image img(input, GD::Png_tag()); // read a png file from input
@@ -292,6 +292,7 @@
 		*/
 		Image(int size, void * data, Png_tag) 
 		:im(0) { CreateFromPng(size, data); }
+#endif
 
 		/** Construct an image by reading from \p in.
 			The tag is an empty struct which simply tells the compiler which image read function to use.
@@ -353,6 +354,7 @@
 		Image(int size, void * data, WBMP_tag) 
 		:im(0) { CreateFromWBMP(size, data); }
 
+#if HAVE_JPEG
 		/** Construct an image by reading from \p in.
 			The tag is an empty struct which simply tells the compiler which image read function to use.
 			e.g. GD::Image img(input, GD::Jpeg_tag()); // read a jpeg file from input
@@ -382,6 +384,7 @@
 		*/
 		Image(int size, void * data, Jpeg_tag) 
 		:im(0) { CreateFromJpeg(size, data); }
+#endif
 
 		/** Construct an image by reading from \p in.
 			The tag is an empty struct which simply tells the compiler which image read function to use.
@@ -525,6 +528,8 @@
 		bool CreateFrom(std::istream & in);
 		/// Read an image from a memory block, after determining the image format
 		bool CreateFrom(int size, void * data);
+
+#if HAVE_PNG
 		// Png
 		bool CreateFromPng(FILE * in)
 			{
@@ -547,6 +552,8 @@
 			istreamIOCtx _in_ctx(in);
 			return ((im = gdImageCreateFromPngCtx( & _in_ctx)) != 0);
 			}
+#endif
+
 		// Gif
 		bool CreateFromGif(FILE * in)
 			{
@@ -591,6 +598,8 @@
 			istreamIOCtx _in_ctx(in);
 			return ((im = gdImageCreateFromWBMPCtx( & _in_ctx)) != 0);
 			}
+
+#if HAVE_JPEG
 		// Jpeg
 		/**
 			Load a truecolor image from a JPEG format file. 
@@ -648,6 +657,8 @@
 			istreamIOCtx _in_ctx(in);
 			return ((im = gdImageCreateFromJpegCtx( & _in_ctx)) != 0);
 			}
+#endif
+
 		// Gd
 		bool CreateFromGd(FILE * in)
 			{
@@ -948,7 +959,8 @@
 			ostreamIOCtx _out_ctx(out);
 			gdImageGifCtx(im, & _out_ctx); 
 			}
-			
+
+#if HAVE_PNG
 		/**
 			Write out this image in PNG file format to \p out.
 			\param out A FILE * handle 
@@ -1009,6 +1021,7 @@
 			ostreamIOCtx _out_ctx(out);
 			gdImagePngCtxEx(im, & _out_ctx, level); 
 			}
+#endif
 
 		/**
 			Write out this image in WBMP file format ( black and white only ) to \p out.
@@ -1042,7 +1055,8 @@
 			ostreamIOCtx _out_ctx(out);
 			gdImageWBMPCtx(im, fg, & _out_ctx); 
 			}
-			
+
+#if HAVE_JPEG
 		/**
 			Write out this image in JPEG file format to \p out.
 			\param out A FILE * handle
@@ -1075,6 +1089,7 @@
 			ostreamIOCtx _out_ctx(out);
 			gdImageJpegCtx(im, & _out_ctx, quality); 
 			}
+#endif
 			
 		void GifAnimBegin(FILE * out, int GlobalCM, int Loops) const
 			{ gdImageGifAnimBegin(im, out, GlobalCM, Loops); }