[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:
Glenn Randers-Pehrson
2017-07-31 14:20:40 -05:00
parent 4ab78af90a
commit 40afb68570
8 changed files with 46 additions and 21 deletions

View File

@@ -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;