more startup debug output
if VIPS_INFO is set
This commit is contained in:
parent
336ee9420a
commit
b9034bf731
@ -1,6 +1,8 @@
|
|||||||
14/8/20 started 8.11.1
|
14/8/20 started 8.11.1
|
||||||
- add more example code to C docs
|
- add more example code to C docs
|
||||||
- update libtool support in configure.ac
|
- update libtool support in configure.ac
|
||||||
|
- more startup info if VIPS_INFO is set
|
||||||
|
- command-line programs set glib prgname (no longer set for you by VIPS_INIT)
|
||||||
|
|
||||||
14/8/20 started 8.11
|
14/8/20 started 8.11
|
||||||
- add vips_jpegload_source() and vips_svgload_source() to public C API
|
- add vips_jpegload_source() and vips_svgload_source() to public C API
|
||||||
|
@ -274,9 +274,7 @@ vips_load_plugins( const char *fmt, ... )
|
|||||||
(void) vips_vsnprintf( dir_name, VIPS_PATH_MAX - 1, fmt, ap );
|
(void) vips_vsnprintf( dir_name, VIPS_PATH_MAX - 1, fmt, ap );
|
||||||
va_end( ap );
|
va_end( ap );
|
||||||
|
|
||||||
#ifdef DEBUG
|
g_info( "searching \"%s\"", dir_name );
|
||||||
printf( "vips_load_plugins: searching \"%s\"\n", dir_name );
|
|
||||||
#endif /*DEBUG*/
|
|
||||||
|
|
||||||
if( !(dir = g_dir_open( dir_name, 0, NULL )) )
|
if( !(dir = g_dir_open( dir_name, 0, NULL )) )
|
||||||
/* Silent success for dir not there.
|
/* Silent success for dir not there.
|
||||||
@ -296,9 +294,7 @@ vips_load_plugins( const char *fmt, ... )
|
|||||||
vips_snprintf( path, VIPS_PATH_MAX - 1,
|
vips_snprintf( path, VIPS_PATH_MAX - 1,
|
||||||
"%s" G_DIR_SEPARATOR_S "%s", dir_name, name );
|
"%s" G_DIR_SEPARATOR_S "%s", dir_name, name );
|
||||||
|
|
||||||
#ifdef DEBUG
|
g_info( "loading \"%s\"", path );
|
||||||
printf( "vips_load_plugins: loading \"%s\"\n", path );
|
|
||||||
#endif /*DEBUG*/
|
|
||||||
|
|
||||||
module = g_module_open( path, G_MODULE_BIND_LAZY );
|
module = g_module_open( path, G_MODULE_BIND_LAZY );
|
||||||
if( !module ) {
|
if( !module ) {
|
||||||
@ -952,10 +948,7 @@ extract_prefix( const char *dir, const char *name )
|
|||||||
char vname[VIPS_PATH_MAX];
|
char vname[VIPS_PATH_MAX];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
#ifdef DEBUG
|
g_info( "trying for dir = \"%s\", name = \"%s\"", dir, name );
|
||||||
printf( "extract_prefix: trying for dir = \"%s\", name = \"%s\"\n",
|
|
||||||
dir, name );
|
|
||||||
#endif /*DEBUG*/
|
|
||||||
|
|
||||||
/* Is dir relative? Prefix with cwd.
|
/* Is dir relative? Prefix with cwd.
|
||||||
*/
|
*/
|
||||||
@ -991,9 +984,7 @@ extract_prefix( const char *dir, const char *name )
|
|||||||
if( vips_ispostfix( vname, G_DIR_SEPARATOR_S ) )
|
if( vips_ispostfix( vname, G_DIR_SEPARATOR_S ) )
|
||||||
vname[strlen( vname ) - 1] = '\0';
|
vname[strlen( vname ) - 1] = '\0';
|
||||||
|
|
||||||
#ifdef DEBUG
|
g_info( "canonicalised path = \"%s\"", vname );
|
||||||
printf( "extract_prefix: canonicalised path = \"%s\"\n", vname );
|
|
||||||
#endif /*DEBUG*/
|
|
||||||
|
|
||||||
/* Ought to be a "/bin" at the end now.
|
/* Ought to be a "/bin" at the end now.
|
||||||
*/
|
*/
|
||||||
@ -1001,9 +992,7 @@ extract_prefix( const char *dir, const char *name )
|
|||||||
return( NULL );
|
return( NULL );
|
||||||
vname[strlen( vname ) - strlen( G_DIR_SEPARATOR_S "bin" )] = '\0';
|
vname[strlen( vname ) - strlen( G_DIR_SEPARATOR_S "bin" )] = '\0';
|
||||||
|
|
||||||
#ifdef DEBUG
|
g_info( "found \"%s\"", vname );
|
||||||
printf( "extract_prefix: found \"%s\"\n", vname );
|
|
||||||
#endif /*DEBUG*/
|
|
||||||
|
|
||||||
return( vips_strdup( NULL, vname ) );
|
return( vips_strdup( NULL, vname ) );
|
||||||
}
|
}
|
||||||
@ -1025,10 +1014,8 @@ scan_path( char *path, const char *name )
|
|||||||
vips_snprintf( str, VIPS_PATH_MAX,
|
vips_snprintf( str, VIPS_PATH_MAX,
|
||||||
"%s" G_DIR_SEPARATOR_S "%s", p, name );
|
"%s" G_DIR_SEPARATOR_S "%s", p, name );
|
||||||
|
|
||||||
#ifdef DEBUG
|
g_info( "looking in \"%s\" for \"%s\"",
|
||||||
printf( "scan_path: looking in \"%s\" for \"%s\"\n",
|
|
||||||
p, name );
|
p, name );
|
||||||
#endif /*DEBUG*/
|
|
||||||
|
|
||||||
if( vips_existsf( "%s", str ) &&
|
if( vips_existsf( "%s", str ) &&
|
||||||
(prefix = extract_prefix( str, name )) ) {
|
(prefix = extract_prefix( str, name )) ) {
|
||||||
@ -1051,9 +1038,7 @@ find_file( const char *name )
|
|||||||
if( !path )
|
if( !path )
|
||||||
return( NULL );
|
return( NULL );
|
||||||
|
|
||||||
#ifdef DEBUG
|
g_info( "g_getenv( \"PATH\" ) == \"%s\"", path );
|
||||||
printf( "vips_guess_prefix: g_getenv( \"PATH\" ) == \"%s\"\n", path );
|
|
||||||
#endif /*DEBUG*/
|
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
{
|
{
|
||||||
@ -1090,10 +1075,7 @@ guess_prefix( const char *argv0, const char *name )
|
|||||||
/* Must point to our executable.
|
/* Must point to our executable.
|
||||||
*/
|
*/
|
||||||
if( (prefix = extract_prefix( argv0, name )) ) {
|
if( (prefix = extract_prefix( argv0, name )) ) {
|
||||||
#ifdef DEBUG
|
g_info( "found \"%s\" from argv0", prefix );
|
||||||
printf( "vips_guess_prefix: found \"%s\" from "
|
|
||||||
"argv0\n", prefix );
|
|
||||||
#endif /*DEBUG*/
|
|
||||||
return( prefix );
|
return( prefix );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1101,10 +1083,7 @@ guess_prefix( const char *argv0, const char *name )
|
|||||||
/* Look along path for name.
|
/* Look along path for name.
|
||||||
*/
|
*/
|
||||||
if( (prefix = find_file( name )) ) {
|
if( (prefix = find_file( name )) ) {
|
||||||
#ifdef DEBUG
|
g_info( "found \"%s\" from PATH", prefix );
|
||||||
printf( "vips_guess_prefix: found \"%s\" from "
|
|
||||||
"PATH\n", prefix );
|
|
||||||
#endif /*DEBUG*/
|
|
||||||
return( prefix );
|
return( prefix );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1127,10 +1106,7 @@ guess_prefix( const char *argv0, const char *name )
|
|||||||
g_free( resolved );
|
g_free( resolved );
|
||||||
|
|
||||||
if( prefix ) {
|
if( prefix ) {
|
||||||
#ifdef DEBUG
|
g_info( "found \"%s\" from cwd", prefix );
|
||||||
printf( "vips_guess_prefix: found \"%s\" "
|
|
||||||
"from cwd\n", prefix );
|
|
||||||
#endif /*DEBUG*/
|
|
||||||
return( prefix );
|
return( prefix );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1168,10 +1144,7 @@ vips_guess_prefix( const char *argv0, const char *env_name )
|
|||||||
/* Already set?
|
/* Already set?
|
||||||
*/
|
*/
|
||||||
if( (prefix = g_getenv( env_name )) ) {
|
if( (prefix = g_getenv( env_name )) ) {
|
||||||
#ifdef DEBUG
|
g_info( "found \"%s\" in environment", prefix );
|
||||||
printf( "vips_guess_prefix: found \"%s\" in environment\n",
|
|
||||||
prefix );
|
|
||||||
#endif /*DEBUG*/
|
|
||||||
return( prefix );
|
return( prefix );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1229,12 +1202,10 @@ vips_guess_libdir( const char *argv0, const char *env_name )
|
|||||||
else
|
else
|
||||||
libdir = g_strdup_printf( "%s/lib", prefix );
|
libdir = g_strdup_printf( "%s/lib", prefix );
|
||||||
|
|
||||||
#ifdef DEBUG
|
g_info( "VIPS_PREFIX = %s", VIPS_PREFIX );
|
||||||
printf( "vips_guess_libdir: VIPS_PREFIX = %s\n", VIPS_PREFIX );
|
g_info( "VIPS_LIBDIR = %s", VIPS_LIBDIR );
|
||||||
printf( "vips_guess_libdir: VIPS_LIBDIR = %s\n", VIPS_LIBDIR );
|
g_info( "prefix = %s", prefix );
|
||||||
printf( "vips_guess_libdir: prefix = %s\n", prefix );
|
g_info( "libdir = %s", libdir );
|
||||||
printf( "vips_guess_libdir: libdir = %s\n", libdir );
|
|
||||||
#endif /*DEBUG*/
|
|
||||||
|
|
||||||
return( libdir );
|
return( libdir );
|
||||||
}
|
}
|
||||||
|
@ -528,6 +528,14 @@ main( int argc, char **argv )
|
|||||||
textdomain( GETTEXT_PACKAGE );
|
textdomain( GETTEXT_PACKAGE );
|
||||||
setlocale( LC_ALL, "" );
|
setlocale( LC_ALL, "" );
|
||||||
|
|
||||||
|
{
|
||||||
|
char *basename;
|
||||||
|
|
||||||
|
basename = g_path_get_basename( argv[0] );
|
||||||
|
g_set_prgname( basename );
|
||||||
|
g_free( basename );
|
||||||
|
}
|
||||||
|
|
||||||
/* On Windows, argv is ascii-only .. use this to get a utf-8 version of
|
/* On Windows, argv is ascii-only .. use this to get a utf-8 version of
|
||||||
* the args.
|
* the args.
|
||||||
*/
|
*/
|
||||||
|
@ -138,6 +138,14 @@ main( int argc, char **argv )
|
|||||||
textdomain( GETTEXT_PACKAGE );
|
textdomain( GETTEXT_PACKAGE );
|
||||||
setlocale( LC_ALL, "" );
|
setlocale( LC_ALL, "" );
|
||||||
|
|
||||||
|
{
|
||||||
|
char *basename;
|
||||||
|
|
||||||
|
basename = g_path_get_basename( argv[0] );
|
||||||
|
g_set_prgname( basename );
|
||||||
|
g_free( basename );
|
||||||
|
}
|
||||||
|
|
||||||
/* On Windows, argv is ascii-only .. use this to get a utf-8 version of
|
/* On Windows, argv is ascii-only .. use this to get a utf-8 version of
|
||||||
* the args.
|
* the args.
|
||||||
*/
|
*/
|
||||||
|
@ -177,6 +177,14 @@ main( int argc, char *argv[] )
|
|||||||
textdomain( GETTEXT_PACKAGE );
|
textdomain( GETTEXT_PACKAGE );
|
||||||
setlocale( LC_ALL, "" );
|
setlocale( LC_ALL, "" );
|
||||||
|
|
||||||
|
{
|
||||||
|
char *basename;
|
||||||
|
|
||||||
|
basename = g_path_get_basename( argv[0] );
|
||||||
|
g_set_prgname( basename );
|
||||||
|
g_free( basename );
|
||||||
|
}
|
||||||
|
|
||||||
/* On Windows, argv is ascii-only .. use this to get a utf-8 version of
|
/* On Windows, argv is ascii-only .. use this to get a utf-8 version of
|
||||||
* the args.
|
* the args.
|
||||||
*/
|
*/
|
||||||
|
@ -493,9 +493,13 @@ main( int argc, char **argv )
|
|||||||
textdomain( GETTEXT_PACKAGE );
|
textdomain( GETTEXT_PACKAGE );
|
||||||
setlocale( LC_ALL, "" );
|
setlocale( LC_ALL, "" );
|
||||||
|
|
||||||
/* The operation cache is not useful for processing many files.
|
{
|
||||||
vips_cache_set_max( 0 );
|
char *basename;
|
||||||
*/
|
|
||||||
|
basename = g_path_get_basename( argv[0] );
|
||||||
|
g_set_prgname( basename );
|
||||||
|
g_free( basename );
|
||||||
|
}
|
||||||
|
|
||||||
/* On Windows, argv is ascii-only .. use this to get a utf-8 version of
|
/* On Windows, argv is ascii-only .. use this to get a utf-8 version of
|
||||||
* the args.
|
* the args.
|
||||||
|
Loading…
Reference in New Issue
Block a user