hide deprecated header fields from _map

just the annoying ipct-data for now
This commit is contained in:
John Cupitt 2018-12-28 15:12:37 +00:00
parent 9c73539258
commit fe2c8505d6
2 changed files with 19 additions and 3 deletions

View File

@ -460,7 +460,7 @@ wtiff_embed_xmp( Wtiff *wtiff, TIFF *tif )
}
static int
wtiff_embed_ipct( Wtiff *wtiff, TIFF *tif )
wtiff_embed_iptc( Wtiff *wtiff, TIFF *tif )
{
void *data;
size_t data_length;
@ -581,7 +581,7 @@ wtiff_write_header( Wtiff *wtiff, Layer *layer )
if( !wtiff->strip )
if( wtiff_embed_profile( wtiff, tif ) ||
wtiff_embed_xmp( wtiff, tif ) ||
wtiff_embed_ipct( wtiff, tif ) ||
wtiff_embed_iptc( wtiff, tif ) ||
wtiff_embed_photoshop( wtiff, tif ) ||
wtiff_embed_imagedescription( wtiff, tif ) )
return( -1 );
@ -1625,7 +1625,7 @@ wtiff_copy_tiff( Wtiff *wtiff, TIFF *out, TIFF *in )
if( !wtiff->strip )
if( wtiff_embed_profile( wtiff, out ) ||
wtiff_embed_xmp( wtiff, out ) ||
wtiff_embed_ipct( wtiff, out ) ||
wtiff_embed_iptc( wtiff, out ) ||
wtiff_embed_photoshop( wtiff, out ) ||
wtiff_embed_imagedescription( wtiff, out ) )
return( -1 );

View File

@ -28,6 +28,8 @@
* - rename "field" as "name" in docs
* 21/11/18
* - get_string will allow G_STRING and REF_STRING
* 28/12/18
* - hide deprecated header fields from _map
*/
/*
@ -1160,9 +1162,23 @@ vips_image_remove( VipsImage *image, const char *name )
return( FALSE );
}
/* Deprecated header fields we hide from _map.
*/
static const char *vips_image_header_deprecated[] = {
"ipct-data"
};
static void *
vips_image_map_fn( VipsMeta *meta, VipsImageMapFn fn, void *a )
{
int i;
/* Hide deprecated fields.
*/
for( i = 0; i < VIPS_NUMBER( vips_image_header_deprecated ); i++ )
if( strcmp( meta->name, vips_image_header_deprecated[i] ) == 0 )
return( NULL );
return( fn( meta->im, meta->name, &meta->value, a ) );
}