mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Made it possible to undefine PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
to get the same (inaccurate) output as libpng-1.5.2 and earlier.
This commit is contained in:
parent
0cb906d804
commit
141d9e3c20
20
ANNOUNCE
20
ANNOUNCE
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Libpng 1.5.3beta11 - June 11, 2011
|
Libpng 1.5.3beta12 - June 13, 2011
|
||||||
|
|
||||||
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.
|
||||||
@ -9,20 +9,20 @@ Files available for download:
|
|||||||
Source files with LF line endings (for Unix/Linux) and with a
|
Source files with LF line endings (for Unix/Linux) and with a
|
||||||
"configure" script
|
"configure" script
|
||||||
|
|
||||||
1.5.3beta11.tar.xz (LZMA-compressed, recommended)
|
1.5.3beta12.tar.xz (LZMA-compressed, recommended)
|
||||||
1.5.3beta11.tar.gz
|
1.5.3beta12.tar.gz
|
||||||
1.5.3beta11.tar.bz2
|
1.5.3beta12.tar.bz2
|
||||||
|
|
||||||
Source files with CRLF line endings (for Windows), without the
|
Source files with CRLF line endings (for Windows), without the
|
||||||
"configure" script
|
"configure" script
|
||||||
|
|
||||||
lp153b11.7z (LZMA-compressed, recommended)
|
lp153b12.7z (LZMA-compressed, recommended)
|
||||||
lp153b11.zip
|
lp153b12.zip
|
||||||
|
|
||||||
Other information:
|
Other information:
|
||||||
|
|
||||||
1.5.3beta11-README.txt
|
1.5.3beta12-README.txt
|
||||||
1.5.3beta11-LICENSE.txt
|
1.5.3beta12-LICENSE.txt
|
||||||
|
|
||||||
Changes since the last public release (1.5.2):
|
Changes since the last public release (1.5.2):
|
||||||
|
|
||||||
@ -181,6 +181,10 @@ Version 1.5.3beta11 [June 11, 2011]
|
|||||||
necessarily fully supportable, particularly png_strncpy and png_snprintf.
|
necessarily fully supportable, particularly png_strncpy and png_snprintf.
|
||||||
Added log option to pngvalid.c and attempted to improve gamma messages.
|
Added log option to pngvalid.c and attempted to improve gamma messages.
|
||||||
|
|
||||||
|
Version 1.5.3beta12 [June 13, 2011]
|
||||||
|
Made it possible to undefine PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
|
||||||
|
to get the same (inaccurate) output as libpng-1.5.2 and earlier.
|
||||||
|
|
||||||
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
|
||||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||||
|
|||||||
4
CHANGES
4
CHANGES
@ -3443,6 +3443,10 @@ Version 1.5.3beta11 [June 11, 2011]
|
|||||||
Removed string/memory macros that are no longer used and are not
|
Removed string/memory macros that are no longer used and are not
|
||||||
necessarily fully supportable, particularly png_strncpy and png_snprintf.
|
necessarily fully supportable, particularly png_strncpy and png_snprintf.
|
||||||
Added log option to pngvalid.c and attempted to improve gamma messages.
|
Added log option to pngvalid.c and attempted to improve gamma messages.
|
||||||
|
|
||||||
|
Version 1.5.3beta12 [June 13, 2011]
|
||||||
|
Made it possible to undefine PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
|
||||||
|
to get the same (inaccurate) output as libpng-1.5.2 and earlier.
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
13
pngrtran.c
13
pngrtran.c
@ -1439,7 +1439,11 @@ png_init_read_transformations(png_structp png_ptr)
|
|||||||
* The PNG_BACKGROUND_EXPAND code above does not expand to 16 bits at
|
* The PNG_BACKGROUND_EXPAND code above does not expand to 16 bits at
|
||||||
* present, so that case is ok (until do_expand_16 is moved.)
|
* present, so that case is ok (until do_expand_16 is moved.)
|
||||||
*/
|
*/
|
||||||
|
#ifdef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
|
||||||
# define CHOP(x) (x)=((png_uint_16)(((png_uint_32)(x)*255+32895) >> 16))
|
# define CHOP(x) (x)=((png_uint_16)(((png_uint_32)(x)*255+32895) >> 16))
|
||||||
|
#else
|
||||||
|
# define CHOP(x) ((png_uint_16)((2*(png_uint_32)(x) + 257)/514))
|
||||||
|
#endif
|
||||||
CHOP(png_ptr->background.red);
|
CHOP(png_ptr->background.red);
|
||||||
CHOP(png_ptr->background.green);
|
CHOP(png_ptr->background.green);
|
||||||
CHOP(png_ptr->background.blue);
|
CHOP(png_ptr->background.blue);
|
||||||
@ -2494,9 +2498,18 @@ png_do_chop(png_row_infop row_info, png_bytep row)
|
|||||||
*
|
*
|
||||||
* (V * 255 + 32895) >> 16
|
* (V * 255 + 32895) >> 16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef PNG_LEGACY_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
|
||||||
|
*dp = *sp + ((((int)(*(sp + 1)) - *sp) > 128) ? 1 : 0);
|
||||||
|
#else
|
||||||
png_int_32 tmp = *sp++; /* must be signed! */
|
png_int_32 tmp = *sp++; /* must be signed! */
|
||||||
|
# ifdef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
|
||||||
tmp += (((int)*sp++ - tmp + 128) * 65535) >> 24;
|
tmp += (((int)*sp++ - tmp + 128) * 65535) >> 24;
|
||||||
|
# else
|
||||||
|
sp++;
|
||||||
|
# endif
|
||||||
*dp++ = (png_byte)tmp;
|
*dp++ = (png_byte)tmp;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
row_info->bit_depth = 8;
|
row_info->bit_depth = 8;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user