vipsthumbnail fix
fix to vipsthumbnail ... --crop could fail for very non-square images, thanks Alessandro
This commit is contained in:
parent
df225a97ff
commit
58239a4583
@ -12,6 +12,7 @@
|
||||
- vipsthumbnail has --rotate auto-rotate option
|
||||
- removed embedded thumbnail reader from vipsthumbnail: embedded thumbnails
|
||||
are too unlike the main image
|
||||
- fix to vipsthumbnail --crop, thanks Alessandro
|
||||
|
||||
6/3/14 started 7.38.6
|
||||
- grey ramp minimum was wrong
|
||||
|
@ -199,13 +199,19 @@ calculate_shrink( VipsImage *im, double *residual )
|
||||
int shrink = floor( factor2 );
|
||||
|
||||
if( residual ) {
|
||||
/* Width after int shrink.
|
||||
/* Size after int shrink. We have to try with both axes since
|
||||
* if they are very different sizes we'll see different
|
||||
* rounding errors.
|
||||
*/
|
||||
int iwidth = width / shrink;
|
||||
int iheight = height / shrink;
|
||||
|
||||
/* Therefore residual scale factor is.
|
||||
*/
|
||||
*residual = (width / factor) / iwidth;
|
||||
double hresidual = (width / factor) / iwidth;
|
||||
double vresidual = (height / factor) / iheight;
|
||||
|
||||
*residual = VIPS_MAX( hresidual, vresidual );
|
||||
}
|
||||
|
||||
return( shrink );
|
||||
|
Loading…
Reference in New Issue
Block a user