tiny cleanups
This commit is contained in:
parent
f4eb1fcf80
commit
3d40769401
@ -445,16 +445,22 @@ vips_operation_equal( VipsOperation *a, VipsOperation *b )
|
|||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void *
|
||||||
vips__cache_init( void )
|
vips__cache_once_init( void )
|
||||||
{
|
{
|
||||||
if( !vips_cache_table ) {
|
|
||||||
vips_cache_lock = vips_g_mutex_new();
|
vips_cache_lock = vips_g_mutex_new();
|
||||||
|
|
||||||
vips_cache_table = g_hash_table_new(
|
vips_cache_table = g_hash_table_new(
|
||||||
(GHashFunc) vips_operation_hash,
|
(GHashFunc) vips_operation_hash,
|
||||||
(GEqualFunc) vips_operation_equal );
|
(GEqualFunc) vips_operation_equal );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
vips__cache_init( void )
|
||||||
|
{
|
||||||
|
static GOnce once = G_ONCE_INIT;
|
||||||
|
|
||||||
|
g_once( &once, (GThreadFunc) vips__cache_once_init, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
|
@ -281,8 +281,7 @@ vips_thumbnail_open( VipsThumbnail *thumbnail )
|
|||||||
}
|
}
|
||||||
else if( vips_isprefix( "VipsForeignLoadPdf", thumbnail->loader ) ||
|
else if( vips_isprefix( "VipsForeignLoadPdf", thumbnail->loader ) ||
|
||||||
vips_isprefix( "VipsForeignLoadSvg", thumbnail->loader ) ) {
|
vips_isprefix( "VipsForeignLoadSvg", thumbnail->loader ) ) {
|
||||||
scale = 1.0 /
|
scale = 1.0 / vips_thumbnail_calculate_common_shrink( thumbnail,
|
||||||
vips_thumbnail_calculate_common_shrink( thumbnail,
|
|
||||||
thumbnail->input_width, thumbnail->input_height );
|
thumbnail->input_width, thumbnail->input_height );
|
||||||
|
|
||||||
g_info( "loading PDF/SVG with factor %g pre-scale", scale );
|
g_info( "loading PDF/SVG with factor %g pre-scale", scale );
|
||||||
@ -698,6 +697,11 @@ vips_thumbnail_file_open( VipsThumbnail *thumbnail, int shrink, double scale )
|
|||||||
{
|
{
|
||||||
VipsThumbnailFile *file = (VipsThumbnailFile *) thumbnail;
|
VipsThumbnailFile *file = (VipsThumbnailFile *) thumbnail;
|
||||||
|
|
||||||
|
/* If both shrink and scale have been set, something is wrong. It
|
||||||
|
* should be one or the other (or neither).
|
||||||
|
*/
|
||||||
|
g_assert( shrink == 1 || scale == 1.0 );
|
||||||
|
|
||||||
if( shrink != 1 )
|
if( shrink != 1 )
|
||||||
return( vips_image_new_from_file( file->filename,
|
return( vips_image_new_from_file( file->filename,
|
||||||
"access", VIPS_ACCESS_SEQUENTIAL,
|
"access", VIPS_ACCESS_SEQUENTIAL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user