mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng17] Merge with libpng-1.6.14beta07
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. Removed "option WRITE_COMPRESSED_TEXT enables WRITE_TEXT" from pnglibconf.dfa Only mark text chunks as written after successfully writing them.
This commit is contained in:
13
pngwrite.c
13
pngwrite.c
@@ -297,11 +297,14 @@ png_write_info(png_structrp png_ptr, png_const_inforp info_ptr)
|
||||
info_ptr->text[i].lang,
|
||||
info_ptr->text[i].lang_key,
|
||||
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
|
||||
png_warning(png_ptr, "Unable to write international text");
|
||||
png_warning(png_ptr, "Unable to write international text");
|
||||
#endif
|
||||
/* Mark this chunk as written */
|
||||
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
|
||||
}
|
||||
|
||||
/* If we want a compressed text chunk */
|
||||
@@ -311,11 +314,11 @@ png_write_info(png_structrp png_ptr, png_const_inforp info_ptr)
|
||||
/* Write compressed chunk */
|
||||
png_write_zTXt(png_ptr, info_ptr->text[i].key,
|
||||
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
|
||||
png_warning(png_ptr, "Unable to write compressed text");
|
||||
#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)
|
||||
|
||||
Reference in New Issue
Block a user