From 7854ead8776e26e7e5c6e876588eaa90e034a0db Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Tue, 1 Jan 2019 15:26:35 +0000 Subject: [PATCH] PNG loader: attach palette bit depth, if any, as metadata --- libvips/foreign/vipspng.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libvips/foreign/vipspng.c b/libvips/foreign/vipspng.c index 89c65b50..5d980425 100644 --- a/libvips/foreign/vipspng.c +++ b/libvips/foreign/vipspng.c @@ -490,6 +490,11 @@ png2vips_header( Read *read, VipsImage *out ) return( -1 ); } + /* Attach original palette bit depth, if any, as metadata. + */ + if( color_type == PNG_COLOR_TYPE_PALETTE ) + vips_image_set_int( out, "palette-bit-depth", bit_depth ); + return( 0 ); }