Merge pull request #1207 from lovell/png-strip-xmp

PNG writer: ensure XMP metadata is ignored when strip=TRUE
This commit is contained in:
John Cupitt 2019-01-10 10:43:18 +00:00 committed by GitHub
commit 3de9f896ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1067,10 +1067,12 @@ write_vips( Write *write,
VIPS_RINT( in->Xres * 1000 ), VIPS_RINT( in->Yres * 1000 ),
PNG_RESOLUTION_METER );
/* Metadata
*/
if( !strip ) {
/* Set ICC Profile.
*/
if( profile &&
!strip ) {
if( profile ) {
if( strcmp( profile, "none" ) != 0 ) {
void *data;
size_t length;
@ -1089,8 +1091,7 @@ write_vips( Write *write,
PNG_COMPRESSION_TYPE_BASE, data, length );
}
}
else if( vips_image_get_typeof( in, VIPS_META_ICC_NAME ) &&
!strip ) {
else if( vips_image_get_typeof( in, VIPS_META_ICC_NAME ) ) {
void *data;
size_t length;
@ -1131,6 +1132,7 @@ write_vips( Write *write,
if( vips_image_map( in,
write_png_comment, write ) )
return( -1 );
}
#ifdef HAVE_IMAGEQUANT
if( palette ) {