diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 1998-03-07 19:45:37 -0600 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2009-04-06 16:04:20 -0500 |
commit | 397100eb8abf576dc749ee26df15e312c8fe9e57 (patch) | |
tree | f51e922822906b09802b8bfab56b314a4a026034 /example.c | |
parent | 4922b1b6e9de3df7c9575d3884f19bab871bd80f (diff) |
Imported from libpng-1.00.tar
Diffstat (limited to 'example.c')
-rw-r--r-- | example.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -15,7 +15,7 @@ #include "png.h" -/* Check to see if a file is a PNG file using png_sig_cmp(). Returns +/* Check to see if a file is a PNG file using png_check_sig(). Returns * non-zero if the image is a PNG, and 0 if it isn't a PNG. * * If this call is successful, and you are going to keep the file open, @@ -29,7 +29,7 @@ * * Many applications already read the first 2 or 4 bytes from the start * of the image to determine the file type, so it would be easiest just - * to pass the bytes to png_sig_cmp() or even skip that if you know + * to pass the bytes to png_check_sig() or even skip that if you know * you have a PNG file, and call png_set_sig_bytes(). */ #define PNG_BYTES_TO_CHECK 4 @@ -46,7 +46,7 @@ int check_if_png(char *file_name, FILE **fp) return 0; /* Compare the first PNG_BYTES_TO_CHECK bytes of the signature. */ - return(png_sig_cmp(buf, (png_size_t)0, PNG_BYTES_TO_CHECK)); + return(png_check_sig(buf, PNG_BYTES_TO_CHECK)); } /* Read a PNG file. You may want to return an error code if the read @@ -92,7 +92,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */ } /* Allocate/initialize the memory for image information. REQUIRED. */ - info_ptr = png_create_info_struct(png_ptr); + info_ptr = png_create_info_struct(); if (info_ptr == NULL) { fclose(fp); @@ -127,7 +127,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */ #endif no_streams /* Use only one I/O method! */ /* If we have already read some of the signature */ - png_set_sig_bytes(png_ptr, sig_read); + png_set_sig_bytes_read(png_ptr, sig_read); /* The call to png_read_info() gives us all of the information from the * PNG file before the first IDAT (image data chunk). REQUIRED |