Merge pull request #1199 from lovell/png-header-palette-bit-depth

PNG loader: attach palette bit depth, if any, as metadata
This commit is contained in:
John Cupitt 2019-01-01 19:02:22 +00:00 committed by GitHub
commit 2b8db2e594
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -490,6 +490,11 @@ png2vips_header( Read *read, VipsImage *out )
return( -1 ); 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 ); return( 0 );
} }