fix vipsthumbnail --size Nx
oh dear, width but not height size specs to vipsthumbnail were not working thanks jrochkind see https://github.com/jcupitt/libvips/issues/781
This commit is contained in:
parent
990b68b54b
commit
5ec1d5b72f
@ -30,6 +30,7 @@
|
|||||||
- vector path for convolution is more accurate and can handle larger masks
|
- vector path for convolution is more accurate and can handle larger masks
|
||||||
- linear and cubic kernels for reduce are higer quality
|
- linear and cubic kernels for reduce are higer quality
|
||||||
- added vips_value_set_blob_free()
|
- added vips_value_set_blob_free()
|
||||||
|
- "--size Nx" to vipsthumbnail was broken, thanks jrochkind
|
||||||
|
|
||||||
29/8/17 started 8.5.9
|
29/8/17 started 8.5.9
|
||||||
- make --fail stop jpeg read on any libjpeg warning, thanks @mceachen
|
- make --fail stop jpeg read on any libjpeg warning, thanks @mceachen
|
||||||
|
@ -94,6 +94,8 @@
|
|||||||
* - add ! geo modifier
|
* - add ! geo modifier
|
||||||
* 30/8/17
|
* 30/8/17
|
||||||
* - add --intent
|
* - add --intent
|
||||||
|
* 23/10/17
|
||||||
|
* - --size Nx didn't work, argh ... thanks jrochkind
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
@ -310,6 +312,7 @@ thumbnail_parse_geometry( const char *geometry )
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const char *p;
|
const char *p;
|
||||||
|
gboolean had_x;
|
||||||
|
|
||||||
/* w or h missing means replace with a huuuge value to prevent
|
/* w or h missing means replace with a huuuge value to prevent
|
||||||
* reduction or enlargement in that axis.
|
* reduction or enlargement in that axis.
|
||||||
@ -324,13 +327,8 @@ thumbnail_parse_geometry( const char *geometry )
|
|||||||
while( isspace( *p ) )
|
while( isspace( *p ) )
|
||||||
p++;
|
p++;
|
||||||
if( isdigit ( *p ) ) {
|
if( isdigit ( *p ) ) {
|
||||||
/* We have a number! vipsthumbnail history means that "-s 200"
|
thumbnail_width = atoi( p );
|
||||||
* means "200x200", not "200xhuge"
|
|
||||||
*/
|
|
||||||
thumbnail_width = thumbnail_height = atoi( p );
|
|
||||||
|
|
||||||
/* And skip over it.
|
|
||||||
*/
|
|
||||||
while( isdigit( *p ) )
|
while( isdigit( *p ) )
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
@ -339,8 +337,11 @@ thumbnail_parse_geometry( const char *geometry )
|
|||||||
*/
|
*/
|
||||||
while( isspace( *p ) )
|
while( isspace( *p ) )
|
||||||
p++;
|
p++;
|
||||||
if( *p == 'x' )
|
had_x = FALSE;
|
||||||
|
if( *p == 'x' ) {
|
||||||
p += 1;
|
p += 1;
|
||||||
|
had_x = TRUE;
|
||||||
|
}
|
||||||
while( isspace( *p ) )
|
while( isspace( *p ) )
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
@ -370,6 +371,12 @@ thumbnail_parse_geometry( const char *geometry )
|
|||||||
return( -1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If there was no 'x' we have just width. vipsthumbnail history means
|
||||||
|
* this is a square bounding box.
|
||||||
|
*/
|
||||||
|
if( !had_x )
|
||||||
|
thumbnail_height = thumbnail_width;
|
||||||
|
|
||||||
/* If force is set and one of width or height isn't set, copy from the
|
/* If force is set and one of width or height isn't set, copy from the
|
||||||
* one that is.
|
* one that is.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user