From c24e47e3a861fb7836d0050626ed0c0464b5a853 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 17 Jan 2019 16:36:25 +0000 Subject: [PATCH] fix profile attach on colour output some dead code needed removing https://github.com/libvips/libvips/issues/1194#issuecomment-455164899 --- libvips/colour/colour.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/libvips/colour/colour.c b/libvips/colour/colour.c index 6db43ddd..90f86566 100644 --- a/libvips/colour/colour.c +++ b/libvips/colour/colour.c @@ -255,21 +255,6 @@ vips_colour_gen( VipsRegion *or, return( 0 ); } -static int -vips_colour_attach_profile( VipsImage *im, const char *filename ) -{ - char *data; - size_t data_length; - - if( !(data = vips__file_read_name( filename, vips__icc_dir(), - &data_length )) ) - return( -1 ); - vips_image_set_blob( im, VIPS_META_ICC_NAME, - (VipsCallbackFn) g_free, data, data_length ); - - return( 0 ); -} - static int vips_colour_build( VipsObject *object ) { @@ -356,12 +341,9 @@ vips_colour_build( VipsObject *object ) out->BandFmt = colour->format; out->Bands = colour->bands; - if( colour->profile_filename ) - if( vips_colour_attach_profile( out, - colour->profile_filename ) ) { - g_object_unref( out ); - return( -1 ); - } + if( colour->profile_filename && + vips__profile_set( out, colour->profile_filename ) ) + return( -1 ); if( vips_image_generate( out, vips_start_many, vips_colour_gen, vips_stop_many,