comparison src/glyphs-x.c @ 98:0d2f883870bc r20-1b1

Import from CVS: tag r20-1b1
author cvs
date Mon, 13 Aug 2007 09:13:56 +0200
parents 6a378aca36af
children 4be1180a9e89
comparison
equal deleted inserted replaced
97:498bf5da1c90 98:0d2f883870bc
1052 #include "jpeglib.h" 1052 #include "jpeglib.h"
1053 #include "jerror.h" 1053 #include "jerror.h"
1054 1054
1055 /* The in-core jpeg code doesn't work, so I'm avoiding it for now. -sb */ 1055 /* The in-core jpeg code doesn't work, so I'm avoiding it for now. -sb */
1056 #define USE_TEMP_FILES_FOR_JPEG_IMAGES 1 1056 #define USE_TEMP_FILES_FOR_JPEG_IMAGES 1
1057 #define USE_TEMP_FILES_FOR_PNG_IMAGES 1
1057 1058
1058 static void 1059 static void
1059 jpeg_validate (Lisp_Object instantiator) 1060 jpeg_validate (Lisp_Object instantiator)
1060 { 1061 {
1061 file_or_data_must_be_present (instantiator); 1062 file_or_data_must_be_present (instantiator);
1873 png_possible_dest_types (void) 1874 png_possible_dest_types (void)
1874 { 1875 {
1875 return IMAGE_COLOR_PIXMAP_MASK; 1876 return IMAGE_COLOR_PIXMAP_MASK;
1876 } 1877 }
1877 1878
1878 #if !defined (USE_TEMP_FILES_FOR_IMAGES) && (PNG_LIBPNG_VER >= 87) 1879 #if !defined (USE_TEMP_FILES_FOR_PNG_IMAGES) && (PNG_LIBPNG_VER >= 87)
1879 struct png_memory_storage 1880 struct png_memory_storage
1880 { 1881 {
1881 Extbyte *bytes; /* The data */ 1882 Extbyte *bytes; /* The data */
1882 Extcount len; /* How big is it? */ 1883 Extcount len; /* How big is it? */
1883 int index; /* Where are we? */ 1884 int index; /* Where are we? */
1892 if (length > (tbr->len - tbr->index)) 1893 if (length > (tbr->len - tbr->index))
1893 png_error (png_ptr, (png_const_charp) "Read Error"); 1894 png_error (png_ptr, (png_const_charp) "Read Error");
1894 memcpy(data,tbr->bytes + tbr->index,length); 1895 memcpy(data,tbr->bytes + tbr->index,length);
1895 tbr->index = tbr->index + length; 1896 tbr->index = tbr->index + length;
1896 } 1897 }
1897 #endif /* !USE_TEMP_FILES_FOR_IMAGESS || PNG_LIBPNG_VER >= 87 */ 1898 #endif /* !USE_TEMP_FILES_FOR_PNG_IMAGESS || PNG_LIBPNG_VER >= 87 */
1898 1899
1899 struct png_unwind_data 1900 struct png_unwind_data
1900 { 1901 {
1901 Display *dpy; 1902 Display *dpy;
1902 FILE *instream; 1903 FILE *instream;
1994 1995
1995 /* This code is a mixture of stuff from Ben's GIF/JPEG stuff from 1996 /* This code is a mixture of stuff from Ben's GIF/JPEG stuff from
1996 this file, example.c from the libpng 0.81 distribution, and the 1997 this file, example.c from the libpng 0.81 distribution, and the
1997 pngtopnm sources. -WMP- 1998 pngtopnm sources. -WMP-
1998 */ 1999 */
1999 #if defined (USE_TEMP_FILES_FOR_IMAGES) || (PNG_LIBPNG_VER < 87) 2000 #if defined (USE_TEMP_FILES_FOR_PNG_IMAGES) || (PNG_LIBPNG_VER < 87)
2000 /* Write out to a temp file - we really should take the time to 2001 /* Write out to a temp file - we really should take the time to
2001 write appropriate memory bound IO stuff, but I am just trying 2002 write appropriate memory bound IO stuff, but I am just trying
2002 to get the stupid thing working right now. 2003 to get the stupid thing working right now.
2003 */ 2004 */
2004 { 2005 {
2030 /* Initialize all PNG structures */ 2031 /* Initialize all PNG structures */
2031 png_info_init (info_ptr); 2032 png_info_init (info_ptr);
2032 png_read_init (png_ptr); 2033 png_read_init (png_ptr);
2033 2034
2034 /* Initialize the IO layer and read in header information */ 2035 /* Initialize the IO layer and read in header information */
2035 #if defined (USE_TEMP_FILES_FOR_IMAGES) || (PNG_LIBPNG_VER < 87) 2036 #if defined (USE_TEMP_FILES_FOR_PNG_IMAGES) || (PNG_LIBPNG_VER < 87)
2036 png_init_io (png_ptr, unwind.instream); 2037 png_init_io (png_ptr, unwind.instream);
2037 #else 2038 #else
2038 { 2039 {
2039 Lisp_Object data = find_keyword_in_vector (instantiator, Q_data); 2040 Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
2040 Extbyte *bytes; 2041 Extbyte *bytes;