Merge branch '8.8'
This commit is contained in:
commit
9a5dca1ef8
@ -28,6 +28,8 @@
|
|||||||
- clip coding and interpretation on vips image read
|
- clip coding and interpretation on vips image read
|
||||||
- check image bounds for GIF load
|
- check image bounds for GIF load
|
||||||
- prevent over-pre-shrink in thumbnail [kleisauke]
|
- prevent over-pre-shrink in thumbnail [kleisauke]
|
||||||
|
- fix sharpen with sigma 0.5 [2h4dl]
|
||||||
|
- sharpen restores input colourspace
|
||||||
|
|
||||||
24/5/19 started 8.8.1
|
24/5/19 started 8.8.1
|
||||||
- improve realpath() use on older libc
|
- improve realpath() use on older libc
|
||||||
|
@ -39,6 +39,9 @@
|
|||||||
* - swap "radius" for "sigma", allows finer control
|
* - swap "radius" for "sigma", allows finer control
|
||||||
* - allow a much greater range of parameters
|
* - allow a much greater range of parameters
|
||||||
* - move to defaults suitable for screen output
|
* - move to defaults suitable for screen output
|
||||||
|
* 28/8/19
|
||||||
|
* - fix sigma 0.5 case (thanks 2h4dl)
|
||||||
|
* - restore input colourspace
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -170,11 +173,12 @@ vips_sharpen_build( VipsObject *object )
|
|||||||
{
|
{
|
||||||
VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object );
|
VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( object );
|
||||||
VipsSharpen *sharpen = (VipsSharpen *) object;
|
VipsSharpen *sharpen = (VipsSharpen *) object;
|
||||||
VipsImage **t = (VipsImage **) vips_object_local_array( object, 7 );
|
VipsImage **t = (VipsImage **) vips_object_local_array( object, 8 );
|
||||||
VipsImage **args = (VipsImage **) vips_object_local_array( object, 2 );
|
VipsImage **args = (VipsImage **) vips_object_local_array( object, 2 );
|
||||||
|
|
||||||
VipsImage *in;
|
VipsImage *in;
|
||||||
int i;
|
int i;
|
||||||
|
VipsInterpretation old_interpretation;
|
||||||
|
|
||||||
VIPS_GATE_START( "vips_sharpen_build: build" );
|
VIPS_GATE_START( "vips_sharpen_build: build" );
|
||||||
|
|
||||||
@ -190,6 +194,7 @@ vips_sharpen_build( VipsObject *object )
|
|||||||
|
|
||||||
in = sharpen->in;
|
in = sharpen->in;
|
||||||
|
|
||||||
|
old_interpretation = in->Type;
|
||||||
if( vips_colourspace( in, &t[0], VIPS_INTERPRETATION_LABS, NULL ) )
|
if( vips_colourspace( in, &t[0], VIPS_INTERPRETATION_LABS, NULL ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
in = t[0];
|
in = t[0];
|
||||||
@ -199,10 +204,10 @@ vips_sharpen_build( VipsObject *object )
|
|||||||
vips_check_format( class->nickname, in, VIPS_FORMAT_SHORT ) )
|
vips_check_format( class->nickname, in, VIPS_FORMAT_SHORT ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
/* Stop at 20% of max ... a bit mean. We always sharpen a short,
|
/* Stop at 10% of max ... a bit mean. We always sharpen a short,
|
||||||
* so there's no point using a float mask.
|
* so there's no point using a float mask.
|
||||||
*/
|
*/
|
||||||
if( vips_gaussmat( &t[1], sharpen->sigma, 0.2,
|
if( vips_gaussmat( &t[1], sharpen->sigma, 0.1,
|
||||||
"separable", TRUE,
|
"separable", TRUE,
|
||||||
"precision", VIPS_PRECISION_INTEGER,
|
"precision", VIPS_PRECISION_INTEGER,
|
||||||
NULL ) )
|
NULL ) )
|
||||||
@ -284,10 +289,11 @@ vips_sharpen_build( VipsObject *object )
|
|||||||
|
|
||||||
g_object_set( object, "out", vips_image_new(), NULL );
|
g_object_set( object, "out", vips_image_new(), NULL );
|
||||||
|
|
||||||
/* Reattach the rest.
|
/* Reattach the rest, back to the start colourspace.
|
||||||
*/
|
*/
|
||||||
if( vips_bandjoin2( t[5], t[3], &t[6], NULL ) ||
|
if( vips_bandjoin2( t[5], t[3], &t[6], NULL ) ||
|
||||||
vips_image_write( t[6], sharpen->out ) )
|
vips_colourspace( t[6], &t[7], old_interpretation, NULL ) ||
|
||||||
|
vips_image_write( t[7], sharpen->out ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
VIPS_GATE_STOP( "vips_sharpen_build: build" );
|
VIPS_GATE_STOP( "vips_sharpen_build: build" );
|
||||||
|
Loading…
Reference in New Issue
Block a user