better handling of jpeg warnings
This commit is contained in:
parent
b183d32b15
commit
8653b23810
@ -398,6 +398,8 @@ vips_tile_destroy( VipsTile *tile )
|
|||||||
static void
|
static void
|
||||||
vips_block_cache_init( VipsBlockCache *cache )
|
vips_block_cache_init( VipsBlockCache *cache )
|
||||||
{
|
{
|
||||||
|
printf( "vips_block_cache_init\n" );
|
||||||
|
|
||||||
cache->tile_width = 128;
|
cache->tile_width = 128;
|
||||||
cache->tile_height = 128;
|
cache->tile_height = 128;
|
||||||
cache->max_tiles = 1000;
|
cache->max_tiles = 1000;
|
||||||
@ -652,10 +654,6 @@ vips_line_cache_build( VipsObject *object )
|
|||||||
block_cache->tile_width = block_cache->in->Xsize;
|
block_cache->tile_width = block_cache->in->Xsize;
|
||||||
block_cache->tile_height = 1;
|
block_cache->tile_height = 1;
|
||||||
|
|
||||||
/* This adjust with request size, see vips_line_cache_gen().
|
|
||||||
*/
|
|
||||||
block_cache->max_tiles = 100;
|
|
||||||
|
|
||||||
if( vips_image_pio_input( block_cache->in ) )
|
if( vips_image_pio_input( block_cache->in ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
@ -692,6 +690,13 @@ vips_line_cache_class_init( VipsLineCacheClass *class )
|
|||||||
static void
|
static void
|
||||||
vips_line_cache_init( VipsLineCache *cache )
|
vips_line_cache_init( VipsLineCache *cache )
|
||||||
{
|
{
|
||||||
|
printf( "vips_line_cache_init\n" );
|
||||||
|
|
||||||
|
/* This adjust with request size, see vips_line_cache_gen().
|
||||||
|
*/
|
||||||
|
((VipsBlockCache *) cache)->max_tiles = 500;
|
||||||
|
|
||||||
|
((VipsBlockCache *) cache)->strategy = VIPS_CACHE_SEQUENTIAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -167,7 +167,7 @@ readjpeg_free( ReadJpeg *jpeg )
|
|||||||
vips_warn( "VipsJpeg",
|
vips_warn( "VipsJpeg",
|
||||||
_( "read gave %ld warnings" ),
|
_( "read gave %ld warnings" ),
|
||||||
jpeg->eman.pub.num_warnings );
|
jpeg->eman.pub.num_warnings );
|
||||||
vips_warn( "VipsJpeg", "%s", vips_error_buffer() );
|
vips_warn( NULL, "%s", vips_error_buffer() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make the message only appear once.
|
/* Make the message only appear once.
|
||||||
|
@ -202,6 +202,7 @@ write_new( VipsImage *in )
|
|||||||
write->cinfo.err = jpeg_std_error( &write->eman.pub );
|
write->cinfo.err = jpeg_std_error( &write->eman.pub );
|
||||||
write->eman.pub.error_exit = vips__new_error_exit;
|
write->eman.pub.error_exit = vips__new_error_exit;
|
||||||
write->eman.pub.output_message = vips__new_output_message;
|
write->eman.pub.output_message = vips__new_output_message;
|
||||||
|
write->eman.pub.output_message = vips__new_output_message;
|
||||||
write->eman.fp = NULL;
|
write->eman.fp = NULL;
|
||||||
write->profile_bytes = NULL;
|
write->profile_bytes = NULL;
|
||||||
write->profile_length = 0;
|
write->profile_length = 0;
|
||||||
|
@ -311,6 +311,7 @@ vips_vdiag( const char *domain, const char *fmt, va_list ap )
|
|||||||
if( !g_getenv( IM_DIAGNOSTICS ) ) {
|
if( !g_getenv( IM_DIAGNOSTICS ) ) {
|
||||||
g_mutex_lock( vips__global_lock );
|
g_mutex_lock( vips__global_lock );
|
||||||
(void) fprintf( stderr, _( "%s: " ), _( "vips diagnostic" ) );
|
(void) fprintf( stderr, _( "%s: " ), _( "vips diagnostic" ) );
|
||||||
|
if( domain )
|
||||||
(void) fprintf( stderr, _( "%s: " ), domain );
|
(void) fprintf( stderr, _( "%s: " ), domain );
|
||||||
(void) vfprintf( stderr, fmt, ap );
|
(void) vfprintf( stderr, fmt, ap );
|
||||||
(void) fprintf( stderr, "\n" );
|
(void) fprintf( stderr, "\n" );
|
||||||
@ -361,6 +362,7 @@ vips_vwarn( const char *domain, const char *fmt, va_list ap )
|
|||||||
if( !g_getenv( IM_WARNING ) ) {
|
if( !g_getenv( IM_WARNING ) ) {
|
||||||
g_mutex_lock( vips__global_lock );
|
g_mutex_lock( vips__global_lock );
|
||||||
(void) fprintf( stderr, _( "%s: " ), _( "vips warning" ) );
|
(void) fprintf( stderr, _( "%s: " ), _( "vips warning" ) );
|
||||||
|
if( domain )
|
||||||
(void) fprintf( stderr, _( "%s: " ), domain );
|
(void) fprintf( stderr, _( "%s: " ), domain );
|
||||||
(void) vfprintf( stderr, fmt, ap );
|
(void) vfprintf( stderr, fmt, ap );
|
||||||
(void) fprintf( stderr, "\n" );
|
(void) fprintf( stderr, "\n" );
|
||||||
|
19
tools/vips.c
19
tools/vips.c
@ -1073,7 +1073,8 @@ main( int argc, char **argv )
|
|||||||
* since we don't want to use the vips7 compat wrappers in vips8
|
* since we don't want to use the vips7 compat wrappers in vips8
|
||||||
* unless we have to. They don't support all args types.
|
* unless we have to. They don't support all args types.
|
||||||
*/
|
*/
|
||||||
if( action && !handled &&
|
if( action &&
|
||||||
|
!handled &&
|
||||||
(fn = im_find_function( action )) ) {
|
(fn = im_find_function( action )) ) {
|
||||||
(void) add_main_group( context, NULL );
|
(void) add_main_group( context, NULL );
|
||||||
parse_options( context, &argc, argv );
|
parse_options( context, &argc, argv );
|
||||||
@ -1087,11 +1088,17 @@ main( int argc, char **argv )
|
|||||||
|
|
||||||
handled = TRUE;
|
handled = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* im_find_function() set an error msg.
|
||||||
|
*/
|
||||||
|
if( action &&
|
||||||
|
!handled )
|
||||||
im_error_clear();
|
im_error_clear();
|
||||||
|
|
||||||
/* Could be a vips8 VipsOperation.
|
/* Could be a vips8 VipsOperation.
|
||||||
*/
|
*/
|
||||||
if( action && !handled &&
|
if( action &&
|
||||||
|
!handled &&
|
||||||
(operation = vips_operation_new( action )) ) {
|
(operation = vips_operation_new( action )) ) {
|
||||||
main_group = add_main_group( context, operation );
|
main_group = add_main_group( context, operation );
|
||||||
vips_call_options( main_group, operation );
|
vips_call_options( main_group, operation );
|
||||||
@ -1113,9 +1120,15 @@ main( int argc, char **argv )
|
|||||||
|
|
||||||
handled = TRUE;
|
handled = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* vips_operation_new() set an error msg for unknown operation.
|
||||||
|
*/
|
||||||
|
if( action &&
|
||||||
|
!handled )
|
||||||
im_error_clear();
|
im_error_clear();
|
||||||
|
|
||||||
if( action && !handled ) {
|
if( action &&
|
||||||
|
!handled ) {
|
||||||
printf( "%s", _( "possible actions:\n" ) );
|
printf( "%s", _( "possible actions:\n" ) );
|
||||||
for( i = 0; i < VIPS_NUMBER( actions ); i++ )
|
for( i = 0; i < VIPS_NUMBER( actions ); i++ )
|
||||||
printf( "%10s - %s\n",
|
printf( "%10s - %s\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user