aboutsummaryrefslogtreecommitdiff
path: root/contrib/examples/pngpixel.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/examples/pngpixel.c')
-rw-r--r--contrib/examples/pngpixel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/examples/pngpixel.c b/contrib/examples/pngpixel.c
index e0d43e3f0..f762379ed 100644
--- a/contrib/examples/pngpixel.c
+++ b/contrib/examples/pngpixel.c
@@ -27,6 +27,8 @@
*/
#include "../../png.h"
+#if defined(PNG_READ_SUPPORTED) && defined(PNG_SEQUENTIAL_READ_SUPPORTED)
+
/* Return component 'c' of pixel 'x' from the given row. */
static unsigned int
component(png_const_bytep row, png_uint_32 x, unsigned int c,
@@ -85,7 +87,7 @@ print_pixel(png_structp png_ptr, png_infop info_ptr, png_const_bytep row,
*/
case PNG_COLOR_TYPE_PALETTE:
{
- PNG_CONST unsigned int index = component(row, x, 0, bit_depth, 1);
+ PNG_CONST int index = component(row, x, 0, bit_depth, 1);
png_colorp palette = NULL;
int num_palette = 0;
@@ -366,3 +368,4 @@ int main(int argc, const char **argv)
return result;
}
+#endif /* READ && SEQUENTIAL_READ */