mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng15] Fixed CMF optimization of non-IDAT compressed chunks,
which was added at libpng-1.5.4. It sometimes produced too small of a window.
This commit is contained in:
parent
0b8b358b98
commit
c4c21f1c87
9
ANNOUNCE
9
ANNOUNCE
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Libpng 1.5.10beta04 - March 9, 2012
|
Libpng 1.5.10beta04 - March 10, 2012
|
||||||
|
|
||||||
This is not intended to be a public release. It will be replaced
|
This is not intended to be a public release. It will be replaced
|
||||||
within a few weeks by a public version or by another test version.
|
within a few weeks by a public version or by another test version.
|
||||||
@ -50,11 +50,10 @@ Version 1.5.10beta03 [March 6, 2012]
|
|||||||
of png_ptr->current_text from pngread.c
|
of png_ptr->current_text from pngread.c
|
||||||
Added palette-index checking.
|
Added palette-index checking.
|
||||||
|
|
||||||
Version 1.5.10beta04 [March 9, 2012]
|
Version 1.5.10beta04 [March 10, 2012]
|
||||||
Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition.
|
Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition.
|
||||||
Disabled part of the CMF optimization of non-IDAT compressed chunks, which
|
Fixed CMF optimization of non-IDAT compressed chunks, which was added at
|
||||||
was added at libpng-1.5.4. It sometimes produces too small of a window.
|
libpng-1.5.4. It sometimes produces too small of a window.
|
||||||
This has been fixed in libpng-1.6.0.
|
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
7
CHANGES
7
CHANGES
@ -3835,11 +3835,10 @@ Version 1.5.10beta03 [March 6, 2012]
|
|||||||
of png_ptr->current_text from pngread.c
|
of png_ptr->current_text from pngread.c
|
||||||
Added palette-index checking.
|
Added palette-index checking.
|
||||||
|
|
||||||
Version 1.5.10beta04 [March 9, 2012]
|
Version 1.5.10beta04 [March 10, 2012]
|
||||||
Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition.
|
Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition.
|
||||||
Disabled part of the CMF optimization of non-IDAT compressed chunks, which
|
Fixed CMF optimization of non-IDAT compressed chunks, which was added at
|
||||||
was added at libpng-1.5.4. It sometimes produces too small of a window.
|
libpng-1.5.4. It sometimes produces too small of a window.
|
||||||
This has been fixed in libpng-1.6.0.
|
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
17
pngwutil.c
17
pngwutil.c
@ -569,14 +569,15 @@ png_text_compress(png_structp png_ptr,
|
|||||||
|
|
||||||
/* Ship the compressed text out via chunk writes */
|
/* Ship the compressed text out via chunk writes */
|
||||||
static void /* PRIVATE */
|
static void /* PRIVATE */
|
||||||
png_write_compressed_data_out(png_structp png_ptr, compression_state *comp)
|
png_write_compressed_data_out(png_structp png_ptr, compression_state *comp,
|
||||||
|
png_size_t data_len)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* Handle the no-compression case */
|
/* Handle the no-compression case */
|
||||||
if (comp->input)
|
if (comp->input)
|
||||||
{
|
{
|
||||||
png_write_chunk_data(png_ptr, comp->input, comp->input_len);
|
png_write_chunk_data(png_ptr, comp->input, data_len);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -585,7 +586,7 @@ png_write_compressed_data_out(png_structp png_ptr, compression_state *comp)
|
|||||||
/* The zbuf_size test is because the code below doesn't work if zbuf_size is
|
/* The zbuf_size test is because the code below doesn't work if zbuf_size is
|
||||||
* '1'; simply skip it to avoid memory overwrite.
|
* '1'; simply skip it to avoid memory overwrite.
|
||||||
*/
|
*/
|
||||||
if (comp->input_len >= 2 && comp->input_len < 16384 && png_ptr->zbuf_size > 1)
|
if (data_len >= 2 && comp->input_len < 16384 && png_ptr->zbuf_size > 1)
|
||||||
{
|
{
|
||||||
unsigned int z_cmf; /* zlib compression method and flags */
|
unsigned int z_cmf; /* zlib compression method and flags */
|
||||||
|
|
||||||
@ -619,7 +620,6 @@ png_write_compressed_data_out(png_structp png_ptr, compression_state *comp)
|
|||||||
if (comp->num_output_ptr)
|
if (comp->num_output_ptr)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if 0 /* The following sometimes produces incorrect zlib datastreams */
|
|
||||||
if (comp->output_ptr[0][0] != z_cmf)
|
if (comp->output_ptr[0][0] != z_cmf)
|
||||||
{
|
{
|
||||||
int tmp;
|
int tmp;
|
||||||
@ -629,7 +629,6 @@ png_write_compressed_data_out(png_structp png_ptr, compression_state *comp)
|
|||||||
tmp += 0x1f - ((z_cmf << 8) + tmp) % 0x1f;
|
tmp += 0x1f - ((z_cmf << 8) + tmp) % 0x1f;
|
||||||
comp->output_ptr[0][1] = (png_byte)tmp;
|
comp->output_ptr[0][1] = (png_byte)tmp;
|
||||||
}
|
}
|
||||||
#endif /* 0 */
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1166,8 +1165,7 @@ png_write_iCCP(png_structp png_ptr, png_const_charp name, int compression_type,
|
|||||||
|
|
||||||
if (profile_len)
|
if (profile_len)
|
||||||
{
|
{
|
||||||
comp.input_len = profile_len;
|
png_write_compressed_data_out(png_ptr, &comp, profile_len);
|
||||||
png_write_compressed_data_out(png_ptr, &comp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
png_write_chunk_end(png_ptr);
|
png_write_chunk_end(png_ptr);
|
||||||
@ -1737,8 +1735,7 @@ png_write_zTXt(png_structp png_ptr, png_const_charp key, png_const_charp text,
|
|||||||
png_write_chunk_data(png_ptr, &buf, (png_size_t)1);
|
png_write_chunk_data(png_ptr, &buf, (png_size_t)1);
|
||||||
|
|
||||||
/* Write the compressed data */
|
/* Write the compressed data */
|
||||||
comp.input_len = text_len;
|
png_write_compressed_data_out(png_ptr, &comp, text_len);
|
||||||
png_write_compressed_data_out(png_ptr, &comp);
|
|
||||||
|
|
||||||
/* Close the chunk */
|
/* Close the chunk */
|
||||||
png_write_chunk_end(png_ptr);
|
png_write_chunk_end(png_ptr);
|
||||||
@ -1829,7 +1826,7 @@ png_write_iTXt(png_structp png_ptr, int compression, png_const_charp key,
|
|||||||
png_write_chunk_data(png_ptr, (lang_key ? (png_const_bytep)lang_key : cbuf),
|
png_write_chunk_data(png_ptr, (lang_key ? (png_const_bytep)lang_key : cbuf),
|
||||||
(png_size_t)(lang_key_len + 1));
|
(png_size_t)(lang_key_len + 1));
|
||||||
|
|
||||||
png_write_compressed_data_out(png_ptr, &comp);
|
png_write_compressed_data_out(png_ptr, &comp, text_len);
|
||||||
|
|
||||||
png_write_chunk_end(png_ptr);
|
png_write_chunk_end(png_ptr);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user