use correct png calls (from the libpng doc) in the png loader and saver. Expedite is running fine

SVN revision: 37527
This commit is contained in:
Vincent Torri 2008-11-06 18:54:19 +00:00
parent 3292fa9100
commit 7e2ccddb48
2 changed files with 5 additions and 5 deletions

View File

@ -59,7 +59,6 @@ evas_image_load_file_head_png(Image_Entry *ie, const char *file, const char *key
fclose(f);
return 0;
}
rewind(f);
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (!png_ptr)
{
@ -73,13 +72,14 @@ evas_image_load_file_head_png(Image_Entry *ie, const char *file, const char *key
fclose(f);
return 0;
}
if (setjmp(png_ptr->jmpbuf))
if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
fclose(f);
return 0;
}
png_init_io(png_ptr, f);
png_set_sig_bytes(png_ptr, PNG_BYTES_TO_CHECK);
png_read_info(png_ptr, info_ptr);
png_get_IHDR(png_ptr, info_ptr, (png_uint_32 *) (&w32),
(png_uint_32 *) (&h32), &bit_depth, &color_type,
@ -129,7 +129,6 @@ evas_image_load_file_data_png(Image_Entry *ie, const char *file, const char *key
fclose(f);
return 0;
}
rewind(f);
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (!png_ptr)
{
@ -143,13 +142,14 @@ evas_image_load_file_data_png(Image_Entry *ie, const char *file, const char *key
fclose(f);
return 0;
}
if (setjmp(png_ptr->jmpbuf))
if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
fclose(f);
return 0;
}
png_init_io(png_ptr, f);
png_set_sig_bytes(png_ptr, PNG_BYTES_TO_CHECK);
png_read_info(png_ptr, info_ptr);
png_get_IHDR(png_ptr, info_ptr, (png_uint_32 *) (&w32),
(png_uint_32 *) (&h32), &bit_depth, &color_type,

View File

@ -55,7 +55,7 @@ save_image_png(RGBA_Image *im, const char *file, int compress, int interlace)
png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
return 0;
}
if (setjmp(png_ptr->jmpbuf))
if (setjmp(png_jmpbuf(png_ptr)))
{
fclose(f);
png_destroy_write_struct(&png_ptr, (png_infopp) & info_ptr);