-
- // expand images of all color-type and bit-depth to 3x8 bit RGB images
- // let the library process things like alpha, transparency, background
-
- if (iBitDepth == 16)
- png_set_strip_16(png_ptr);
+
+ /* expand images of all color-type and bit-depth to 3x8-bit RGB */
+ /* let the library process alpha, transparency, background, etc. */
+
+#ifdef PNG_READ_16_TO_8_SUPPORTED
+ if (iBitDepth == 16)
+# ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
+ png_set_scale_16(png_ptr);
+# else
+ png_set_strip_16(png_ptr);
+# endif
+#endif