Merge branch '8.8'
This commit is contained in:
commit
80f247cfb2
@ -17,6 +17,8 @@ magic number [przemyslawpluta]
|
||||
- remove 256 band limit in arithmetic.c [erdmann]
|
||||
- disable Orc if building with CET [lovell]
|
||||
- fix vipsthumbnail with pyr tiff [kleisauke]
|
||||
- text autofit could occasionally terminate early [levmorozov]
|
||||
- fewer warnings on tiffload [chregu]
|
||||
|
||||
21/9/18 started 8.8.0
|
||||
- much faster smartcrop [lovell]
|
||||
|
@ -28,6 +28,8 @@
|
||||
* 16/3/19
|
||||
* - add `justify`
|
||||
* - set Xoffset/Yoffset to ink left/top
|
||||
* 27/6/19
|
||||
* - fitting could occasionally terminate early [levmorozov]
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -204,18 +206,13 @@ vips_text_get_extents( VipsText *text, VipsRect *extents )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/* Return -ve for extents too small, 0 for a fit, +ve for extents too large.
|
||||
/* Return -ve for extents too small, +ve for extents too large.
|
||||
*/
|
||||
static int
|
||||
vips_text_rect_difference( VipsRect *target, VipsRect *extents )
|
||||
{
|
||||
if( vips_rect_includesrect( target, extents ) ) {
|
||||
if( target->width == extents->width ||
|
||||
target->height == extents->height )
|
||||
return( 0 );
|
||||
|
||||
if( vips_rect_includesrect( target, extents ) )
|
||||
return( -1 );
|
||||
}
|
||||
else
|
||||
return( 1 );
|
||||
}
|
||||
@ -261,10 +258,9 @@ vips_text_autofit( VipsText *text )
|
||||
previous_difference = difference;
|
||||
}
|
||||
|
||||
/* Hit the size, or we straddle the target.
|
||||
/* Stop if we straddle the target.
|
||||
*/
|
||||
if( difference == 0 ||
|
||||
difference != previous_difference )
|
||||
if( difference != previous_difference )
|
||||
break;
|
||||
|
||||
previous_difference = difference;
|
||||
|
@ -254,6 +254,7 @@ typedef struct _RtiffHeader {
|
||||
gboolean separate;
|
||||
int orientation;
|
||||
gboolean premultiplied;
|
||||
uint16 compression;
|
||||
|
||||
/* Result of TIFFIsTiled().
|
||||
*/
|
||||
@ -1331,9 +1332,12 @@ rtiff_set_header( Rtiff *rtiff, VipsImage *out )
|
||||
uint32 data_length;
|
||||
void *data;
|
||||
|
||||
/* Request YCbCr expansion.
|
||||
/* Request YCbCr expansion. libtiff complains if you do this for
|
||||
* non-jpg images.
|
||||
*/
|
||||
TIFFSetField( rtiff->tiff, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB );
|
||||
if( rtiff->header.compression == COMPRESSION_JPEG )
|
||||
TIFFSetField( rtiff->tiff,
|
||||
TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB );
|
||||
|
||||
out->Xsize = rtiff->header.width;
|
||||
out->Ysize = rtiff->header.height * rtiff->n;
|
||||
@ -2074,7 +2078,6 @@ rtiff_header_read( Rtiff *rtiff, RtiffHeader *header )
|
||||
{
|
||||
uint16 extra_samples_count;
|
||||
uint16 *extra_samples_types;
|
||||
uint16 compression;
|
||||
|
||||
if( !tfget32( rtiff->tiff, TIFFTAG_IMAGEWIDTH, &header->width ) ||
|
||||
!tfget32( rtiff->tiff, TIFFTAG_IMAGELENGTH, &header->height ) ||
|
||||
@ -2088,8 +2091,8 @@ rtiff_header_read( Rtiff *rtiff, RtiffHeader *header )
|
||||
return( -1 );
|
||||
|
||||
TIFFGetFieldDefaulted( rtiff->tiff,
|
||||
TIFFTAG_COMPRESSION, &compression );
|
||||
if( compression == COMPRESSION_JPEG )
|
||||
TIFFTAG_COMPRESSION, &header->compression );
|
||||
if( header->compression == COMPRESSION_JPEG )
|
||||
/* We want to always expand subsampled YCBCR images to full
|
||||
* RGB.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user