@@ -2574,7 +2574,7 @@ modifier_init(png_modifier *pm)
2574
2574
* in the rgb_to_gray check, replacing it with an exact copy of the libpng 1.5
2575
2575
* algorithm.
2576
2576
*/
2577
- #define DIGITIZE PNG_LIBPNG_VER < 10700
2577
+ #define DIGITIZE PNG_LIBPNG_VER != 10700
2578
2578
2579
2579
/* If pm->calculations_use_input_precision is set then operations will happen
2580
2580
* with the precision of the input, not the precision of the output depth.
@@ -3986,7 +3986,7 @@ transform_row(png_const_structp pp, png_byte buffer[TRANSFORM_ROWMAX],
3986
3986
# define check_interlace_type (type ) ((void)(type))
3987
3987
# define set_write_interlace_handling (pp ,type ) png_set_interlace_handling(pp)
3988
3988
# define do_own_interlace 0
3989
- #elif PNG_LIBPNG_VER < 10700
3989
+ #elif PNG_LIBPNG_VER != 10700
3990
3990
# define set_write_interlace_handling (pp ,type ) (1)
3991
3991
static void
3992
3992
check_interlace_type (int const interlace_type )
@@ -4014,7 +4014,7 @@ check_interlace_type(int const interlace_type)
4014
4014
# define do_own_interlace 1
4015
4015
#endif /* WRITE_INTERLACING tests */
4016
4016
4017
- #if PNG_LIBPNG_VER > = 10700 || defined PNG_WRITE_INTERLACING_SUPPORTED
4017
+ #if PNG_LIBPNG_VER = = 10700 || defined PNG_WRITE_INTERLACING_SUPPORTED
4018
4018
# define CAN_WRITE_INTERLACE 1
4019
4019
#else
4020
4020
# define CAN_WRITE_INTERLACE 0
@@ -4633,10 +4633,10 @@ static const struct
4633
4633
{
4634
4634
/* no warnings makes these errors undetectable prior to 1.7.0 */
4635
4635
{ sBIT0_error_fn , "sBIT(0): failed to detect error" ,
4636
- PNG_LIBPNG_VER < 10700 },
4636
+ PNG_LIBPNG_VER != 10700 },
4637
4637
4638
4638
{ sBIT_error_fn , "sBIT(too big): failed to detect error" ,
4639
- PNG_LIBPNG_VER < 10700 },
4639
+ PNG_LIBPNG_VER != 10700 },
4640
4640
};
4641
4641
4642
4642
static void
@@ -6236,7 +6236,7 @@ image_pixel_add_alpha(image_pixel *this, const standard_display *display,
6236
6236
{
6237
6237
if (this -> colour_type == PNG_COLOR_TYPE_GRAY )
6238
6238
{
6239
- # if PNG_LIBPNG_VER < 10700
6239
+ # if PNG_LIBPNG_VER != 10700
6240
6240
if (!for_background && this -> bit_depth < 8 )
6241
6241
this -> bit_depth = this -> sample_depth = 8 ;
6242
6242
# endif
@@ -6246,7 +6246,7 @@ image_pixel_add_alpha(image_pixel *this, const standard_display *display,
6246
6246
/* After 1.7 the expansion of bit depth only happens if there is a
6247
6247
* tRNS chunk to expand at this point.
6248
6248
*/
6249
- # if PNG_LIBPNG_VER > = 10700
6249
+ # if PNG_LIBPNG_VER = = 10700
6250
6250
if (!for_background && this -> bit_depth < 8 )
6251
6251
this -> bit_depth = this -> sample_depth = 8 ;
6252
6252
# endif
@@ -7127,7 +7127,7 @@ image_transform_png_set_tRNS_to_alpha_mod(const image_transform *this,
7127
7127
image_pixel * that , png_const_structp pp ,
7128
7128
const transform_display * display )
7129
7129
{
7130
- #if PNG_LIBPNG_VER < 10700
7130
+ #if PNG_LIBPNG_VER != 10700
7131
7131
/* LIBPNG BUG: this always forces palette images to RGB. */
7132
7132
if (that -> colour_type == PNG_COLOR_TYPE_PALETTE )
7133
7133
image_pixel_convert_PLTE (that );
@@ -7137,13 +7137,13 @@ image_transform_png_set_tRNS_to_alpha_mod(const image_transform *this,
7137
7137
* convert to an alpha channel.
7138
7138
*/
7139
7139
if (that -> have_tRNS )
7140
- # if PNG_LIBPNG_VER > = 10700
7140
+ # if PNG_LIBPNG_VER = = 10700
7141
7141
if (that -> colour_type != PNG_COLOR_TYPE_PALETTE &&
7142
7142
(that -> colour_type & PNG_COLOR_MASK_ALPHA ) == 0 )
7143
7143
# endif
7144
7144
image_pixel_add_alpha (that , & display -> this , 0 /*!for background*/ );
7145
7145
7146
- #if PNG_LIBPNG_VER < 10700
7146
+ #if PNG_LIBPNG_VER != 10700
7147
7147
/* LIBPNG BUG: otherwise libpng still expands to 8 bits! */
7148
7148
else
7149
7149
{
@@ -7172,7 +7172,7 @@ image_transform_png_set_tRNS_to_alpha_add(image_transform *this,
7172
7172
* any action on a palette image.
7173
7173
*/
7174
7174
return
7175
- # if PNG_LIBPNG_VER > = 10700
7175
+ # if PNG_LIBPNG_VER = = 10700
7176
7176
colour_type != PNG_COLOR_TYPE_PALETTE &&
7177
7177
# endif
7178
7178
(colour_type & PNG_COLOR_MASK_ALPHA ) == 0 ;
@@ -7313,7 +7313,7 @@ image_transform_png_set_expand_gray_1_2_4_to_8_mod(
7313
7313
const image_transform * this , image_pixel * that , png_const_structp pp ,
7314
7314
const transform_display * display )
7315
7315
{
7316
- #if PNG_LIBPNG_VER < 10700
7316
+ #if PNG_LIBPNG_VER != 10700
7317
7317
image_transform_png_set_expand_mod (this , that , pp , display );
7318
7318
#else
7319
7319
/* Only expand grayscale of bit depth less than 8: */
@@ -7329,7 +7329,7 @@ static int
7329
7329
image_transform_png_set_expand_gray_1_2_4_to_8_add (image_transform * this ,
7330
7330
const image_transform * * that , png_byte colour_type , png_byte bit_depth )
7331
7331
{
7332
- #if PNG_LIBPNG_VER < 10700
7332
+ #if PNG_LIBPNG_VER != 10700
7333
7333
return image_transform_png_set_expand_add (this , that , colour_type ,
7334
7334
bit_depth );
7335
7335
#else
@@ -7359,7 +7359,7 @@ image_transform_png_set_expand_16_set(const image_transform *this,
7359
7359
png_set_expand_16 (pp );
7360
7360
7361
7361
/* NOTE: prior to 1.7 libpng does SET_EXPAND as well, so tRNS is expanded. */
7362
- # if PNG_LIBPNG_VER < 10700
7362
+ # if PNG_LIBPNG_VER != 10700
7363
7363
if (that -> this .has_tRNS )
7364
7364
that -> this .is_transparent = 1 ;
7365
7365
# endif
@@ -7412,7 +7412,7 @@ image_transform_png_set_scale_16_set(const image_transform *this,
7412
7412
transform_display * that , png_structp pp , png_infop pi )
7413
7413
{
7414
7414
png_set_scale_16 (pp );
7415
- # if PNG_LIBPNG_VER < 10700
7415
+ # if PNG_LIBPNG_VER != 10700
7416
7416
/* libpng will limit the gamma table size: */
7417
7417
that -> max_gamma_8 = PNG_MAX_GAMMA_8 ;
7418
7418
# endif
@@ -7460,7 +7460,7 @@ image_transform_png_set_strip_16_set(const image_transform *this,
7460
7460
transform_display * that , png_structp pp , png_infop pi )
7461
7461
{
7462
7462
png_set_strip_16 (pp );
7463
- # if PNG_LIBPNG_VER < 10700
7463
+ # if PNG_LIBPNG_VER != 10700
7464
7464
/* libpng will limit the gamma table size: */
7465
7465
that -> max_gamma_8 = PNG_MAX_GAMMA_8 ;
7466
7466
# endif
@@ -7647,7 +7647,7 @@ image_transform_png_set_rgb_to_gray_ini(const image_transform *this,
7647
7647
else
7648
7648
{
7649
7649
/* The default (built in) coefficients, as above: */
7650
- # if PNG_LIBPNG_VER < 10700
7650
+ # if PNG_LIBPNG_VER != 10700
7651
7651
data .red_coefficient = 6968 / 32768. ;
7652
7652
data .green_coefficient = 23434 / 32768. ;
7653
7653
data .blue_coefficient = 2366 / 32768. ;
@@ -7730,7 +7730,7 @@ image_transform_png_set_rgb_to_gray_ini(const image_transform *this,
7730
7730
* conversion adds another +/-2 in the 16-bit case and
7731
7731
* +/-(1<<(15-PNG_MAX_GAMMA_8)) in the 8-bit case.
7732
7732
*/
7733
- # if PNG_LIBPNG_VER < 10700
7733
+ # if PNG_LIBPNG_VER != 10700
7734
7734
if (that -> this .bit_depth < 16 )
7735
7735
that -> max_gamma_8 = PNG_MAX_GAMMA_8 ;
7736
7736
# endif
@@ -7907,7 +7907,7 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
7907
7907
{
7908
7908
double gray , err ;
7909
7909
7910
- # if PNG_LIBPNG_VER < 10700
7910
+ # if PNG_LIBPNG_VER != 10700
7911
7911
if (that -> colour_type == PNG_COLOR_TYPE_PALETTE )
7912
7912
image_pixel_convert_PLTE (that );
7913
7913
# endif
@@ -8094,7 +8094,7 @@ image_transform_png_set_rgb_to_gray_mod(const image_transform *this,
8094
8094
double b = that -> bluef ;
8095
8095
double be = that -> bluee ;
8096
8096
8097
- # if PNG_LIBPNG_VER < 10700
8097
+ # if PNG_LIBPNG_VER != 10700
8098
8098
/* The true gray case involves no math in earlier versions (not
8099
8099
* true, there was some if gamma correction was happening too.)
8100
8100
*/
@@ -9873,7 +9873,7 @@ gamma_component_validate(const char *name, const validate_info *vi,
9873
9873
* lost. This can result in up to a +/-1 error in the presence of
9874
9874
* an sbit less than the bit depth.
9875
9875
*/
9876
- # if PNG_LIBPNG_VER < 10700
9876
+ # if PNG_LIBPNG_VER != 10700
9877
9877
# define SBIT_ERROR .5
9878
9878
# else
9879
9879
# define SBIT_ERROR 1.
@@ -10733,7 +10733,7 @@ static void perform_gamma_scale16_tests(png_modifier *pm)
10733
10733
# ifndef PNG_MAX_GAMMA_8
10734
10734
# define PNG_MAX_GAMMA_8 11
10735
10735
# endif
10736
- # if defined PNG_MAX_GAMMA_8 || PNG_LIBPNG_VER < 10700
10736
+ # if defined PNG_MAX_GAMMA_8 || PNG_LIBPNG_VER != 10700
10737
10737
# define SBIT_16_TO_8 PNG_MAX_GAMMA_8
10738
10738
# else
10739
10739
# define SBIT_16_TO_8 16
@@ -11736,7 +11736,7 @@ int main(int argc, char **argv)
11736
11736
* code that 16-bit arithmetic is used for 8-bit samples when it would make a
11737
11737
* difference.
11738
11738
*/
11739
- pm .assume_16_bit_calculations = PNG_LIBPNG_VER > = 10700 ;
11739
+ pm .assume_16_bit_calculations = PNG_LIBPNG_VER = = 10700 ;
11740
11740
11741
11741
/* Currently 16 bit expansion happens at the end of the pipeline, so the
11742
11742
* calculations are done in the input bit depth not the output.
@@ -11760,13 +11760,13 @@ int main(int argc, char **argv)
11760
11760
pm .test_lbg_gamma_threshold = 1 ;
11761
11761
pm .test_lbg_gamma_transform = PNG_LIBPNG_VER >= 10600 ;
11762
11762
pm .test_lbg_gamma_sbit = 1 ;
11763
- pm .test_lbg_gamma_composition = PNG_LIBPNG_VER > = 10700 ;
11763
+ pm .test_lbg_gamma_composition = PNG_LIBPNG_VER = = 10700 ;
11764
11764
11765
11765
/* And the test encodings */
11766
11766
pm .encodings = test_encodings ;
11767
11767
pm .nencodings = ARRAY_SIZE (test_encodings );
11768
11768
11769
- # if PNG_LIBPNG_VER < 10700
11769
+ # if PNG_LIBPNG_VER != 10700
11770
11770
pm .sbitlow = 8U ; /* because libpng doesn't do sBIT below 8! */
11771
11771
# else
11772
11772
pm .sbitlow = 1U ;
@@ -11796,7 +11796,7 @@ int main(int argc, char **argv)
11796
11796
pm .maxout16 = .499 ; /* Error in *encoded* value */
11797
11797
pm .maxabs16 = .00005 ;/* 1/20000 */
11798
11798
pm .maxcalc16 = 1. /65535 ;/* +/-1 in 16 bits for compose errors */
11799
- # if PNG_LIBPNG_VER < 10700
11799
+ # if PNG_LIBPNG_VER != 10700
11800
11800
pm .maxcalcG = 1. /((1 <<PNG_MAX_GAMMA_8 )- 1 );
11801
11801
# else
11802
11802
pm .maxcalcG = 1. /((1 <<16 )- 1 );
0 commit comments