mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Added calls to png_handle_eXIf(() in pngread.c and png_write_eXIf()
in pngwrite.c, and made various other fixes to png_write_eXIf(). Eliminated png_ptr->num_exif member from pngstruct.h and added num_exif to arguments for png_get_eXIf() and png_set_eXIf().
This commit is contained in:
6
pngset.c
6
pngset.c
@@ -137,7 +137,7 @@ png_set_cHRM_XYZ(png_const_structrp png_ptr, png_inforp info_ptr, double red_X,
|
||||
#ifdef PNG_eXIf_SUPPORTED
|
||||
void PNGAPI
|
||||
png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
|
||||
const png_bytep eXIf_buf)
|
||||
const png_uint_32 num_exif, const png_bytep eXIf_buf)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -148,6 +148,8 @@ png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
|
||||
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_EXIF, 0);
|
||||
|
||||
info_ptr->num_exif = num_exif;
|
||||
|
||||
info_ptr->exif = png_voidcast(png_bytep, png_malloc_warn(png_ptr,
|
||||
info_ptr->num_exif));
|
||||
|
||||
@@ -160,7 +162,7 @@ png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
|
||||
|
||||
info_ptr->free_me |= PNG_FREE_EXIF;
|
||||
|
||||
for (i = 0; i < info_ptr->num_exif; i++)
|
||||
for (i = 0; i < (int) num_exif; i++)
|
||||
info_ptr->exif[i] = eXIf_buf[i];
|
||||
|
||||
info_ptr->valid |= PNG_INFO_eXIf;
|
||||
|
||||
Reference in New Issue
Block a user