vips_colourspace() could fail

for images with alpha channels
This commit is contained in:
John Cupitt 2013-11-14 13:55:23 +00:00
parent a01e2e3e13
commit 82f680484c
3 changed files with 14 additions and 15 deletions

View File

@ -1,7 +1,8 @@
19/10/13 started 7.37.0
- redone im_rotate_*mask45(), im_gauss_*mask*(), im_log_*mask(), im_dilate(),
im_erode(), im_rank_image(), im_compass(), im_linedet(), im_gradient(),
im_convsep(), im_convsep_f(), im_fastcor(), im_spcor() as classes
im_convsep(), im_convsep_f(), im_fastcor(), im_spcor(), im_sharpen()
as classes
- im_gradcor() deprecated
- vips_init() now does some ABI compat checking, though this change requires
an ABI break

15
TODO
View File

@ -1,10 +1,10 @@
- try:
$ vips colourspace Opera-icon-high-res.png x.v labs
$ header x.v
x.v: 3056x3325 float, 4 bands, labs, pngload
- add vips_gaussian_blur() with approx / int / float precision, maybe
vips_resize() as well?
o.O should be short innit?
could share a base class with vips_sharpen()/
- do morph quickly as simple wrappers over the vips7 operations
- support --strip for other writers
@ -20,11 +20,6 @@
note on memuse page
- do conv and morph quickly as simple wrappers over the vips7 operations
- add vips_gaussian_blur() with approx / int / float precision, maybe
vips_resize() as well?
- do much fancier profiling with timing on all locks saved in memory and
dumped on exit

View File

@ -481,12 +481,11 @@ vips_colour_code_build( VipsObject *object )
VipsColour *colour = VIPS_COLOUR( object );
VipsColourCode *code = VIPS_COLOUR_CODE( object );
VipsColourCodeClass *class = VIPS_COLOUR_CODE_GET_CLASS( object );
VipsImage **t = (VipsImage **) vips_object_local_array( object, 6 );
VipsImage **t;
VipsImage *in;
VipsImage *extra;
t = (VipsImage **) vips_object_local_array( object, 5 );
in = code->in;
extra = NULL;
@ -559,15 +558,19 @@ vips_colour_code_build( VipsObject *object )
return( -1 );
/* Reattach higher bands, if necessary.
*
* Our processing on the first three bands may have changed the image
* format. For example, converting LAB to LABS will make a short
* image. We need to force the extra bands to match this new type.
*/
if( extra ) {
VipsImage *x;
if( vips_bandjoin2( colour->out, extra, &x, NULL ) )
if( vips_cast( extra, &t[5], colour->out->BandFmt, NULL ) ||
vips_bandjoin2( colour->out, t[5], &x, NULL ) )
return( -1 );
VIPS_UNREF( colour->out );
colour->out = x;
}