Merge branch 'master' into try-round-to-nearest

This commit is contained in:
John Cupitt 2016-09-05 13:07:40 +01:00
commit c522dae625
8 changed files with 47 additions and 16 deletions

View File

@ -41,6 +41,9 @@
- resize/reduce*/shrink*/affine now round output size to nearest rather than
rounding down, thanks ioquatix
19/8/16 started 8.3.4
- better transparency handling in gifload, thanks diegocsandrim
30/7/16 started 8.3.3
- fix performance regression in 8.3.2, thanks Lovell
- yet more robust vips file reading

View File

@ -37,9 +37,9 @@ VIPS_VERSION_STRING=$VIPS_VERSION-`date`
# binary interface changes backwards compatible?: increment age
# binary interface changes not backwards compatible?: reset age to 0
LIBRARY_CURRENT=46
LIBRARY_REVISION=3
LIBRARY_AGE=4
LIBRARY_CURRENT=47
LIBRARY_REVISION=1
LIBRARY_AGE=5
# patched into include/vips/version.h
AC_SUBST(VIPS_VERSION)

View File

@ -1265,7 +1265,11 @@ vips_icc_ac2rc( VipsImage *in, VipsImage **out, const char *profile_filename )
*
* If @embedded is set, the input profile is taken from the input image
* metadata. If there is no embedded profile,
* @input_profile_filename is used as a fall-back.
* @input_profile_filename is used as a fall-back.
* You can test for the
* presence of an embedded profile with
* vips_image_get_typeof() with #VIPS_META_ICC_NAME as an argument. This will
* return %GType 0 if there is no profile.
*
* If @embedded is not set, the input profile is taken from
* @input_profile. If @input_profile is not supplied, the
@ -1342,11 +1346,18 @@ vips_icc_export( VipsImage *in, VipsImage **out, ... )
* If @embedded is set, the input profile is taken from the input image
* metadata, if present. If there is no embedded profile,
* @input_profile is used as a fall-back.
* You can test for the
* presence of an embedded profile with
* vips_image_get_typeof() with #VIPS_META_ICC_NAME as an argument. This will
* return %GType 0 if there is no profile.
*
* If @embedded is not set, the input profile is taken from
* @input_profile. If @input_profile is not supplied, the
* metadata profile, if any, is used as a fall-back.
*
* The output image has the output profile attached to the #VIPS_META_ICC_NAME
* field.
*
* Use vips_icc_import() and vips_icc_export() to do either the first or
* second half of this operation in isolation.
*

View File

@ -7,6 +7,8 @@
* 26/7/16
* - transparency was wrong if there was no EXTENSION_RECORD
* - write 1, 2, 3, or 4 bands depending on file contents
* 19/8/16
* - better transparency detection, thanks diegocsandrim
*/
/*
@ -513,9 +515,10 @@ vips_foreign_load_gif_to_memory( VipsForeignLoadGif *gif, VipsImage *out )
if( ext_code == GRAPHICS_EXT_FUNC_CODE &&
extension &&
extension[0] == 4 &&
extension[1] == 1 ) {
(extension[1] & 0x1) ) {
/* Bytes are 4, 1, delay low, delay high,
* transparency.
* transparency. Bit 1 means transparency
* is being set.
*/
gif->transparency = extension[4];
gif->has_transparency = TRUE;
@ -826,7 +829,7 @@ vips_foreign_load_gif_buffer_init( VipsForeignLoadGifBuffer *buffer )
*
* Optional arguments:
*
* * @page: %ginit, page (frame) to read
* * @page: %gint, page (frame) to read
*
* Read a GIF file into a VIPS image. Rendering uses the giflib library.
*
@ -861,7 +864,7 @@ vips_gifload( const char *filename, VipsImage **out, ... )
*
* Optional arguments:
*
* * @page: %ginit, page (frame) to read
* * @page: %gint, page (frame) to read
*
* Read a GIF-formatted memory block into a VIPS image. Exactly as
* vips_gifload(), but read from a memory buffer.

View File

@ -301,7 +301,7 @@ vips_foreign_load_tiff_buffer_init( VipsForeignLoadTiffBuffer *buffer )
*
* Optional arguments:
*
* * @page: int, load this page
* * @page: %gint, load this page
* * @autorotate: %gboolean, use orientation tag to rotate the image
* during load
*

View File

@ -168,13 +168,11 @@ vips__b64_encode( const unsigned char *data, size_t data_length )
int i;
int cursor;
if( data_length == 0 ) {
vips_error( "vips__b64_encode", "%s", _( "too little data" ) );
return( NULL );
}
if( output_data_length > 1024 * 1024 ) {
if( output_data_length > 10 * 1024 * 1024 ) {
/* We shouldn't really be used for large amounts of data, plus
* we are using int offsets.
*
* A large ICC profile can be 1MB, so allow 10MB of b64.
*/
vips_error( "vips__b64_encode", "%s", _( "too much data" ) );
return( NULL );
@ -228,9 +226,10 @@ vips__b64_decode( const char *buffer, size_t *data_length )
{
const size_t buffer_length = strlen( buffer );
/* Worst case.
/* Worst case. Add one, since we don't want to return NULL for an empty
* input string, it would look like an error return.
*/
const size_t output_data_length = buffer_length * 3 / 4;
const size_t output_data_length = 1 + buffer_length * 3 / 4;
unsigned char *data;
unsigned char *p;

View File

@ -467,8 +467,13 @@ vips_leak( void )
vips_buf_append_size( &buf, vips_tracked_get_mem_highwater() );
vips_buf_appends( &buf, "\n" );
if( strlen( vips_error_buffer() ) > 0 )
vips_buf_appendf( &buf, "error buffer: %s",
vips_error_buffer() );
fprintf( stderr, "%s", vips_buf_all( &buf ) );
#ifdef DEBUG
vips_buffer_dump_all();
#endif /*DEBUG*/

View File

@ -670,6 +670,11 @@ transform_blob_save_string( const GValue *src_value, GValue *dest_value )
vips_value_set_save_string( dest_value, b64 );
vips_free( b64 );
}
else
/* No error return from transform, but we should set it to
* something.
*/
vips_value_set_save_string( dest_value, "" );
}
static void
@ -683,6 +688,11 @@ transform_save_string_blob( const GValue *src_value, GValue *dest_value )
if( (blob = vips__b64_decode( b64, &blob_length )) )
vips_value_set_blob( dest_value,
(VipsCallbackFn) vips_free, blob, blob_length );
else
/* No error return from transform, but we should set it to
* something.
*/
vips_value_set_save_string( dest_value, "" );
}
GType