[libpng16] Only mark text chunks as written after successfully writing them.
This commit is contained in:
parent
f56c00f050
commit
a11cd84160
4
ANNOUNCE
4
ANNOUNCE
@ -61,8 +61,12 @@ Version 1.6.14beta06 [October 5, 2014]
|
|||||||
Replaced repeated code in pngpread.c with PNG_PUSH_SAVE_BUFFER_IF_FULL.
|
Replaced repeated code in pngpread.c with PNG_PUSH_SAVE_BUFFER_IF_FULL.
|
||||||
Added "chunk iTXt enables TEXT" and "chunk zTXt enables TEXT"
|
Added "chunk iTXt enables TEXT" and "chunk zTXt enables TEXT"
|
||||||
to pnglibconf.dfa.
|
to pnglibconf.dfa.
|
||||||
|
Removed "option READ_COMPRESSED_TEXT enables READ_TEXT" from pnglibconf.dfa,
|
||||||
|
to make it possible to configure a libpng that supports iCCP but not TEXT.
|
||||||
|
|
||||||
Version 1.6.14beta07 [October 5, 2014]
|
Version 1.6.14beta07 [October 5, 2014]
|
||||||
|
Removed "option WRITE_COMPRESSED_TEXT enables WRITE_TEXT" from pnglibconf.dfa
|
||||||
|
Only mark text chunks as written after successfully writing them.
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
4
CHANGES
4
CHANGES
@ -5014,8 +5014,12 @@ Version 1.6.14beta06 [October 5, 2014]
|
|||||||
Replaced repeated code in pngpread.c with PNG_PUSH_SAVE_BUFFER_IF_FULL.
|
Replaced repeated code in pngpread.c with PNG_PUSH_SAVE_BUFFER_IF_FULL.
|
||||||
Added "chunk iTXt enables TEXT" and "chunk zTXt enables TEXT"
|
Added "chunk iTXt enables TEXT" and "chunk zTXt enables TEXT"
|
||||||
to pnglibconf.dfa.
|
to pnglibconf.dfa.
|
||||||
|
Removed "option READ_COMPRESSED_TEXT enables READ_TEXT" from pnglibconf.dfa,
|
||||||
|
to make it possible to configure a libpng that supports iCCP but not TEXT.
|
||||||
|
|
||||||
Version 1.6.14beta07 [October 5, 2014]
|
Version 1.6.14beta07 [October 5, 2014]
|
||||||
|
Removed "option WRITE_COMPRESSED_TEXT enables WRITE_TEXT" from pnglibconf.dfa
|
||||||
|
Only mark text chunks as written after successfully writing them.
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
@ -932,7 +932,7 @@ void write_png(char *file_name /* , ... other image information ... */)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Once we write out the header, the compression type on the text
|
/* Once we write out the header, the compression type on the text
|
||||||
* chunks gets changed to PNG_TEXT_COMPRESSION_NONE_WR or
|
* chunk gets changed to PNG_TEXT_COMPRESSION_NONE_WR or
|
||||||
* PNG_TEXT_COMPRESSION_zTXt_WR, so it doesn't get written out again
|
* PNG_TEXT_COMPRESSION_zTXt_WR, so it doesn't get written out again
|
||||||
* at the end.
|
* at the end.
|
||||||
*/
|
*/
|
||||||
|
@ -396,6 +396,7 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
|
|||||||
row_info.pixel_depth = png_ptr->pixel_depth;
|
row_info.pixel_depth = png_ptr->pixel_depth;
|
||||||
row_info.rowbytes = PNG_ROWBYTES(row_info.pixel_depth, row_info.width);
|
row_info.rowbytes = PNG_ROWBYTES(row_info.pixel_depth, row_info.width);
|
||||||
|
|
||||||
|
#ifdef PNG_WARNINGS_SUPPORTED
|
||||||
if (png_ptr->row_number == 0 && png_ptr->pass == 0)
|
if (png_ptr->row_number == 0 && png_ptr->pass == 0)
|
||||||
{
|
{
|
||||||
/* Check for transforms that have been set but were defined out */
|
/* Check for transforms that have been set but were defined out */
|
||||||
@ -435,6 +436,7 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
|
|||||||
png_warning(png_ptr, "PNG_READ_SWAP_SUPPORTED is not defined");
|
png_warning(png_ptr, "PNG_READ_SWAP_SUPPORTED is not defined");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif /* PNG_WARNINGS_SUPPORTED */
|
||||||
|
|
||||||
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||||
/* If interlaced and we do not need a new row, combine row and return.
|
/* If interlaced and we do not need a new row, combine row and return.
|
||||||
|
13
pngwrite.c
13
pngwrite.c
@ -292,11 +292,14 @@ png_write_info(png_structrp png_ptr, png_const_inforp info_ptr)
|
|||||||
info_ptr->text[i].lang,
|
info_ptr->text[i].lang,
|
||||||
info_ptr->text[i].lang_key,
|
info_ptr->text[i].lang_key,
|
||||||
info_ptr->text[i].text);
|
info_ptr->text[i].text);
|
||||||
|
/* Mark this chunk as written */
|
||||||
|
if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
|
||||||
|
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
|
||||||
|
else
|
||||||
|
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
|
||||||
#else
|
#else
|
||||||
png_warning(png_ptr, "Unable to write international text");
|
png_warning(png_ptr, "Unable to write international text");
|
||||||
#endif
|
#endif
|
||||||
/* Mark this chunk as written */
|
|
||||||
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we want a compressed text chunk */
|
/* If we want a compressed text chunk */
|
||||||
@ -306,11 +309,11 @@ png_write_info(png_structrp png_ptr, png_const_inforp info_ptr)
|
|||||||
/* Write compressed chunk */
|
/* Write compressed chunk */
|
||||||
png_write_zTXt(png_ptr, info_ptr->text[i].key,
|
png_write_zTXt(png_ptr, info_ptr->text[i].key,
|
||||||
info_ptr->text[i].text, info_ptr->text[i].compression);
|
info_ptr->text[i].text, info_ptr->text[i].compression);
|
||||||
|
/* Mark this chunk as written */
|
||||||
|
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
|
||||||
#else
|
#else
|
||||||
png_warning(png_ptr, "Unable to write compressed text");
|
png_warning(png_ptr, "Unable to write compressed text");
|
||||||
#endif
|
#endif
|
||||||
/* Mark this chunk as written */
|
|
||||||
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
|
else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
|
||||||
|
Loading…
Reference in New Issue
Block a user