use VIPS_ prefix for env vars

stuff
This commit is contained in:
John Cupitt 2014-04-26 18:45:13 +01:00
parent 034df70866
commit ee88271d06
7 changed files with 19 additions and 46 deletions

33
TODO
View File

@ -1,47 +1,18 @@
- clean in nip2 is broken - clean in nip2 is broken
looks like the offset in morph embed is wrong works if you use --vips-novector
no, worse, try 14.04 is orc-0.4.18, there must have been a change
0 0 0
0 1 0
0 0 0
erode ... fails badly
try with vector disabled?
- make all
if( (env = g_getenv( "IM_DISC_THRESHOLD" )) )
be eg.
if( (env = g_getenv( "VIPS_DISC_THRESHOLD" )) ||
(env = g_getenv( "IM_DISC_THRESHOLD" )) )
- use this for dzsave_buffer
- clean up foreign.c, there seems to be some cruft
- vips_filename_suffix_match() is used by - vips_filename_suffix_match() is used by
vips_foreign_load_new_from_foreign_sub(), but it splits on ':' ... argh! vips_foreign_load_new_from_foreign_sub(), but it splits on ':' ... argh!
deprecate this thing and stop ':' split deprecate this thing and stop ':' split
vips_foreign_find_save() should split on [], there's something to find the
start of the rightmost [] pair, use that
see also vips_foreign_find_save_buffer()

View File

@ -744,7 +744,8 @@ vips_get_disc_threshold( void )
*/ */
threshold = 100 * 1024 * 1024; threshold = 100 * 1024 * 1024;
if( (env = g_getenv( "IM_DISC_THRESHOLD" )) ) if( (env = g_getenv( "VIPS_DISC_THRESHOLD" )) ||
(env = g_getenv( "IM_DISC_THRESHOLD" )) )
threshold = vips__parse_size( env ); threshold = vips__parse_size( env );
if( vips__disc_threshold ) if( vips__disc_threshold )

View File

@ -408,7 +408,7 @@ vips_info( const char *domain, const char *fmt, ... )
* @ap: arguments to the format string * @ap: arguments to the format string
* *
* Sends a formatted warning message to stderr. If you define the * Sends a formatted warning message to stderr. If you define the
* environment variable IM_WARNING, these message are surpressed. * environment variable VIPS_WARNING, these message are surpressed.
* *
* Warning messages are used to report things like overflow counts. * Warning messages are used to report things like overflow counts.
* *
@ -417,7 +417,8 @@ vips_info( const char *domain, const char *fmt, ... )
void void
vips_vwarn( const char *domain, const char *fmt, va_list ap ) vips_vwarn( const char *domain, const char *fmt, va_list ap )
{ {
if( !g_getenv( "IM_WARNING" ) ) { if( !g_getenv( "IM_WARNING" ) &&
!g_getenv( "VIPS_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 ) if( domain )

View File

@ -737,6 +737,7 @@ static void
vips_image_add_progress( VipsImage *image ) vips_image_add_progress( VipsImage *image )
{ {
if( vips__progress || if( vips__progress ||
g_getenv( "VIPS_PROGRESS" ) ||
g_getenv( "IM_PROGRESS" ) ) { g_getenv( "IM_PROGRESS" ) ) {
/* Keep the %complete we displayed last time here. /* Keep the %complete we displayed last time here.
@ -1578,7 +1579,7 @@ vips_image_new( void )
* location for the temporary file. * location for the temporary file.
* *
* The disc threshold can be set with the "--vips-disc-threshold" * The disc threshold can be set with the "--vips-disc-threshold"
* command-line argument, or the IM_DISC_THRESHOLD environment variable. * command-line argument, or the VIPS_DISC_THRESHOLD environment variable.
* The value is a simple integer, but can take a unit postfix of "k", * The value is a simple integer, but can take a unit postfix of "k",
* "m" or "g" to indicate kilobytes, megabytes or gigabytes. * "m" or "g" to indicate kilobytes, megabytes or gigabytes.
* *

View File

@ -244,7 +244,8 @@ vips__init( const char *argv0 )
/* Default info setting from env. /* Default info setting from env.
*/ */
if( g_getenv( "IM_INFO" ) ) if( g_getenv( "VIPS_INFO" ) ||
g_getenv( "IM_INFO" ) )
vips__info = 1; vips__info = 1;
/* Register base vips types. /* Register base vips types.

View File

@ -82,14 +82,10 @@
*/ */
/* Maximum number of concurrent threads we allow. No reason for the limit, /* Maximum number of concurrent threads we allow. No reason for the limit,
* it's just there to stop mad values for IM_CONCURRENCY killing the system. * it's just there to stop mad values for VIPS_CONCURRENCY killing the system.
*/ */
#define MAX_THREADS (1024) #define MAX_THREADS (1024)
/* Name of environment variable we get concurrency level from.
*/
#define IM_CONCURRENCY "IM_CONCURRENCY"
/* Default tile geometry ... can be set by init_world. /* Default tile geometry ... can be set by init_world.
*/ */
int vips__tile_width = VIPS__TILE_WIDTH; int vips__tile_width = VIPS__TILE_WIDTH;
@ -220,7 +216,7 @@ vips_g_thread_new( const char *domain, GThreadFunc func, gpointer data )
* #VipsThreadPool. * #VipsThreadPool.
* *
* The special value 0 means "default". In this case, the number of threads is * The special value 0 means "default". In this case, the number of threads is
* set by the environmnt variable IM_CONCURRENCY, or if that is not set, the * set by the environmnt variable VIPS_CONCURRENCY, or if that is not set, the
* number of threads availble on the hist machine. * number of threads availble on the hist machine.
* *
* See also: vips_concurrency_get(). * See also: vips_concurrency_get().
@ -307,9 +303,9 @@ get_num_processors( void )
* "--vips-concurrency" to set this value. * "--vips-concurrency" to set this value.
* *
* If vips_concurrency_set() has not been called and no command-line argument * If vips_concurrency_set() has not been called and no command-line argument
* was used, vips uses the value of the environment variable IM_CONCURRENCY, * was used, vips uses the value of the environment variable VIPS_CONCURRENCY,
* *
* If IM_CONCURRENCY has not been set, vips find the number of hardware * If VIPS_CONCURRENCY has not been set, vips find the number of hardware
* threads that the host machine can run in parallel and uses that value. * threads that the host machine can run in parallel and uses that value.
* *
* The final value is clipped to the range 1 - 1024. * The final value is clipped to the range 1 - 1024.
@ -329,7 +325,8 @@ vips_concurrency_get( void )
*/ */
if( vips__concurrency > 0 ) if( vips__concurrency > 0 )
nthr = vips__concurrency; nthr = vips__concurrency;
else if( (str = g_getenv( IM_CONCURRENCY )) && else if( ((str = g_getenv( "VIPS_CONCURRENCY" )) ||
(str = g_getenv( "IM_CONCURRENCY" ))) &&
(x = atoi( str )) > 0 ) (x = atoi( str )) > 0 )
nthr = x; nthr = x;
else else

View File

@ -77,7 +77,8 @@ vips_vector_init( void )
/* Look for the environment variable IM_NOVECTOR and use that to turn /* Look for the environment variable IM_NOVECTOR and use that to turn
* off as well. * off as well.
*/ */
if( g_getenv( "IM_NOVECTOR" ) ) if( g_getenv( "VIPS_NOVECTOR" ) ||
g_getenv( "IM_NOVECTOR" ) )
vips__vector_enabled = FALSE; vips__vector_enabled = FALSE;
#endif /*HAVE_ORC*/ #endif /*HAVE_ORC*/
} }