diff --git a/ChangeLog b/ChangeLog index 8f8cf32e..9e54f312 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,7 +17,15 @@ - dzsave --layout google has a @background option - dzsave has a --depth option - update for new glib threading API -- remove no threads option +- remove no threads option, glib no longer support it +- better --help output for vips driver prog +- vipsthumbnail -o allows absolute file names + +14/11/12 started 7.30.6 +- capture tiff warnings earlier + +14/11/12 started 7.30.5 +- fix libtool version mess up (thanks Benjamin) 2/10/12 started 7.30.4 - remove options from format string in .dzi (thanks Martin) diff --git a/README.md b/README.md index e974b468..6bd0cf19 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Then for a debug build: # Dependencies libvips has to have gettext, glib-2.x and libxml-2.0. The build system needs -sh, pkg-config and gnu make. +sh, pkg-config, swig, gtk-doc-tools, automake, gobject-introspection and gnu make. # Optional dependencies diff --git a/TODO b/TODO index 733b1fb9..09cfa291 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,20 @@ + +- have a web page with a list of the python member names + + $ vips cpph all | grep join + VImage bandjoin( VImage bandjoin_in2 ) throw( VError ); + static VImage + gbandjoin( std::vector gbandjoin_in ) throw( VError ); + VImage lrjoin( VImage lrjoin_in2 ) throw( VError ); + VImage tbjoin( VImage tbjoin_in2 ) throw( VError ); + + could generate some docs too? + + perhaps it should be part of vips.c + + +- check libtool version number, should be binary-compat with 7.30 + - quadratic doesn't work for order 3 start to get jaggies on lines --- the 3rd differential isn't being diff --git a/libvips/foreign/tiff.h b/libvips/foreign/tiff.h index d9ab22f4..009c0448 100644 --- a/libvips/foreign/tiff.h +++ b/libvips/foreign/tiff.h @@ -36,8 +36,7 @@ extern "C" { extern const char *vips__foreign_tiff_suffs[]; -void vips__thandler_error( const char *module, const char *fmt, va_list ap ); -void vips__thandler_warning( const char *module, const char *fmt, va_list ap ); +void vips__tiff_init( void ); int vips__tiff_write( VipsImage *in, const char *filename, VipsForeignTiffCompression compression, int Q, diff --git a/libvips/foreign/tiff2vips.c b/libvips/foreign/tiff2vips.c index ddfcf730..7cb8f3c9 100644 --- a/libvips/foreign/tiff2vips.c +++ b/libvips/foreign/tiff2vips.c @@ -229,13 +229,13 @@ typedef struct { * more than one thread, but vips_error and vips_warn have mutexes in, so that's * OK. */ -void +static void vips__thandler_error( const char *module, const char *fmt, va_list ap ) { vips_verror( module, fmt, ap ); } -void +static void vips__thandler_warning( const char *module, const char *fmt, va_list ap ) { char buf[256]; @@ -244,6 +244,16 @@ vips__thandler_warning( const char *module, const char *fmt, va_list ap ) vips_warn( module, "%s", buf ); } +/* Call this during startup. Other libraries may be using libtiff and we want + * to capture any messages they send as well. + */ +void +vips__tiff_init( void ) +{ + TIFFSetErrorHandler( vips__thandler_error ); + TIFFSetWarningHandler( vips__thandler_warning ); +} + /* Test for field exists. */ static int @@ -1506,8 +1516,7 @@ istiffpyramid( const char *name ) { TIFF *tif; - TIFFSetErrorHandler( vips__thandler_error ); - TIFFSetWarningHandler( vips__thandler_warning ); + vips__tiff_init(); if( (tif = get_directory( name, 2 )) ) { // We can see page 2 ... assume it is. @@ -1529,8 +1538,7 @@ vips__tiff_read( const char *filename, VipsImage *out, int page ) printf( "tiff2vips: libtiff starting for %s\n", filename ); #endif /*DEBUG*/ - TIFFSetErrorHandler( vips__thandler_error ); - TIFFSetWarningHandler( vips__thandler_warning ); + vips__tiff_init(); if( !(rtiff = readtiff_new( filename, out, page )) ) return( -1 ); @@ -1558,8 +1566,7 @@ vips__tiff_read_header( const char *filename, VipsImage *out, int page ) { ReadTiff *rtiff; - TIFFSetErrorHandler( vips__thandler_error ); - TIFFSetWarningHandler( vips__thandler_warning ); + vips__tiff_init(); if( !(rtiff = readtiff_new( filename, out, page )) ) return( -1 ); @@ -1583,10 +1590,7 @@ vips__istifftiled( const char *filename ) TIFF *tif; gboolean tiled; - /* Override the default TIFF error handler. - */ - TIFFSetErrorHandler( vips__thandler_error ); - TIFFSetWarningHandler( vips__thandler_warning ); + vips__tiff_init(); if( !(tif = TIFFOpen( filename, "rm" )) ) { vips_error_clear(); diff --git a/libvips/foreign/tiffload.c b/libvips/foreign/tiffload.c index 1c229646..267458c9 100644 --- a/libvips/foreign/tiffload.c +++ b/libvips/foreign/tiffload.c @@ -123,6 +123,13 @@ vips_foreign_load_tiff_class_init( VipsForeignLoadTiffClass *class ) VipsForeignClass *foreign_class = (VipsForeignClass *) class; VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; + /* Other libraries may be using libtiff, we want to capture tiff + * warning and error as soon as we can. + * + * This class init will be triggered during startup. + */ + vips__tiff_init(); + gobject_class->set_property = vips_object_set_property; gobject_class->get_property = vips_object_get_property; diff --git a/libvips/foreign/vips2tiff.c b/libvips/foreign/vips2tiff.c index 872f2dd7..93d89f6d 100644 --- a/libvips/foreign/vips2tiff.c +++ b/libvips/foreign/vips2tiff.c @@ -1474,7 +1474,6 @@ gather_pyramid( TiffWrite *tw ) return( 0 ); } - int vips__tiff_write( VipsImage *in, const char *filename, VipsForeignTiffCompression compression, int Q, @@ -1493,10 +1492,7 @@ vips__tiff_write( VipsImage *in, const char *filename, printf( "tiff2vips: libtiff version is \"%s\"\n", TIFFGetVersion() ); #endif /*DEBUG*/ - /* Override the default TIFF error handler. - */ - TIFFSetErrorHandler( vips__thandler_error ); - TIFFSetWarningHandler( vips__thandler_warning ); + vips__tiff_init(); /* Check input image. */ diff --git a/po/vips7.pot b/po/vips7.pot index 74e442bc..46196cb3 100644 --- a/po/vips7.pot +++ b/po/vips7.pot @@ -10,10 +10,14 @@ msgstr "" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "product=glib&keywords=I18N+L10N&component=general\n" <<<<<<< HEAD +<<<<<<< HEAD "POT-Creation-Date: 2012-09-08 14:01+0100\n" ======= "POT-Creation-Date: 2012-10-01 14:17+0100\n" >>>>>>> origin/master +======= +"POT-Creation-Date: 2012-11-14 09:36+0000\n" +>>>>>>> origin/7.30 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -400,10 +404,14 @@ msgstr "" #: ../libvips/conversion/bandjoin.c:171 ../libvips/conversion/copy.c:321 #: ../libvips/conversion/rot.c:359 ../libvips/conversion/replicate.c:196 <<<<<<< HEAD +<<<<<<< HEAD #: ../libvips/conversion/tilecache.c:355 ../libvips/conversion/embed.c:523 ======= #: ../libvips/conversion/tilecache.c:357 ../libvips/conversion/embed.c:523 >>>>>>> origin/master +======= +#: ../libvips/conversion/tilecache.c:359 ../libvips/conversion/embed.c:523 +>>>>>>> origin/7.30 #: ../libvips/conversion/cache.c:100 ../libvips/conversion/recomb.c:203 #: ../libvips/conversion/sequential.c:273 ../libvips/foreign/foreign.c:1413 #: ../libvips/resample/resample.c:89 @@ -576,10 +584,14 @@ msgstr "" #: ../libvips/conversion/extract.c:198 ../libvips/conversion/extract.c:357 #: ../libvips/conversion/copy.c:322 ../libvips/conversion/rot.c:360 <<<<<<< HEAD +<<<<<<< HEAD #: ../libvips/conversion/replicate.c:197 ../libvips/conversion/tilecache.c:356 ======= #: ../libvips/conversion/replicate.c:197 ../libvips/conversion/tilecache.c:358 >>>>>>> origin/master +======= +#: ../libvips/conversion/replicate.c:197 ../libvips/conversion/tilecache.c:360 +>>>>>>> origin/7.30 #: ../libvips/conversion/embed.c:524 ../libvips/conversion/cache.c:101 #: ../libvips/conversion/sequential.c:274 msgid "Input image" @@ -1116,6 +1128,7 @@ msgstr "" msgid "Top edge of sub in main" msgstr "" +<<<<<<< HEAD <<<<<<< HEAD #: ../libvips/conversion/tilecache.c:351 ../libvips/conversion/cache.c:96 msgid "cache an image" @@ -1166,53 +1179,60 @@ msgstr "" #: ../libvips/conversion/tilecache.c:699 ======= #: ../libvips/conversion/tilecache.c:353 ../libvips/conversion/cache.c:96 +======= +#: ../libvips/conversion/tilecache.c:355 ../libvips/conversion/cache.c:96 +>>>>>>> origin/7.30 msgid "cache an image" msgstr "" -#: ../libvips/conversion/tilecache.c:363 ../libvips/conversion/cache.c:113 +#: ../libvips/conversion/tilecache.c:365 ../libvips/conversion/cache.c:113 #: ../libvips/conversion/sequential.c:286 ../libvips/foreign/tiffsave.c:222 -#: ../libvips/foreign/dzsave.c:920 +#: ../libvips/foreign/dzsave.c:927 msgid "Tile height" msgstr "" -#: ../libvips/conversion/tilecache.c:364 ../libvips/conversion/cache.c:114 +#: ../libvips/conversion/tilecache.c:366 ../libvips/conversion/cache.c:114 #: ../libvips/conversion/sequential.c:287 ../libvips/foreign/tiffsave.c:223 -#: ../libvips/foreign/dzsave.c:921 +#: ../libvips/foreign/dzsave.c:928 msgid "Tile height in pixels" msgstr "" -#: ../libvips/conversion/tilecache.c:370 +#: ../libvips/conversion/tilecache.c:372 msgid "Strategy" msgstr "" -#: ../libvips/conversion/tilecache.c:371 +#: ../libvips/conversion/tilecache.c:373 msgid "Expected access pattern" msgstr "" -#: ../libvips/conversion/tilecache.c:540 +#: ../libvips/conversion/tilecache.c:542 msgid "cache an image as a set of tiles" msgstr "" -#: ../libvips/conversion/tilecache.c:544 ../libvips/conversion/cache.c:106 -#: ../libvips/foreign/tiffsave.c:215 ../libvips/foreign/dzsave.c:913 +#: ../libvips/conversion/tilecache.c:546 ../libvips/conversion/cache.c:106 +#: ../libvips/foreign/tiffsave.c:215 ../libvips/foreign/dzsave.c:920 msgid "Tile width" msgstr "" -#: ../libvips/conversion/tilecache.c:545 ../libvips/conversion/cache.c:107 -#: ../libvips/foreign/tiffsave.c:216 ../libvips/foreign/dzsave.c:914 +#: ../libvips/conversion/tilecache.c:547 ../libvips/conversion/cache.c:107 +#: ../libvips/foreign/tiffsave.c:216 ../libvips/foreign/dzsave.c:921 msgid "Tile width in pixels" msgstr "" -#: ../libvips/conversion/tilecache.c:551 ../libvips/conversion/cache.c:120 +#: ../libvips/conversion/tilecache.c:553 ../libvips/conversion/cache.c:120 msgid "Max tiles" msgstr "" -#: ../libvips/conversion/tilecache.c:552 ../libvips/conversion/cache.c:121 +#: ../libvips/conversion/tilecache.c:554 ../libvips/conversion/cache.c:121 msgid "Maximum number of tiles to cache" msgstr "" +<<<<<<< HEAD #: ../libvips/conversion/tilecache.c:706 >>>>>>> origin/master +======= +#: ../libvips/conversion/tilecache.c:709 +>>>>>>> origin/7.30 msgid "cache an image as a set of lines" msgstr "" @@ -1589,48 +1609,48 @@ msgstr "" msgid "Write a bigtiff image" msgstr "" -#: ../libvips/foreign/dzsave.c:243 +#: ../libvips/foreign/dzsave.c:245 #, c-format msgid "Directory \"%s_files\" exists" msgstr "" -#: ../libvips/foreign/dzsave.c:812 +#: ../libvips/foreign/dzsave.c:819 msgid "overlap must be less than tile width and height" msgstr "" -#: ../libvips/foreign/dzsave.c:865 +#: ../libvips/foreign/dzsave.c:872 msgid "save image to deep zoom format" msgstr "" -#: ../libvips/foreign/dzsave.c:875 ../libvips/foreign/dzsave.c:906 +#: ../libvips/foreign/dzsave.c:882 ../libvips/foreign/dzsave.c:913 msgid "Base name" msgstr "" -#: ../libvips/foreign/dzsave.c:876 ../libvips/foreign/dzsave.c:907 +#: ../libvips/foreign/dzsave.c:883 ../libvips/foreign/dzsave.c:914 msgid "Base name to save to" msgstr "" -#: ../libvips/foreign/dzsave.c:882 +#: ../libvips/foreign/dzsave.c:889 msgid "suffix" msgstr "" -#: ../libvips/foreign/dzsave.c:883 +#: ../libvips/foreign/dzsave.c:890 msgid "Filename suffix for tiles" msgstr "" -#: ../libvips/foreign/dzsave.c:889 +#: ../libvips/foreign/dzsave.c:896 msgid "Overlap" msgstr "" -#: ../libvips/foreign/dzsave.c:890 +#: ../libvips/foreign/dzsave.c:897 msgid "Tile overlap in pixels" msgstr "" -#: ../libvips/foreign/dzsave.c:896 +#: ../libvips/foreign/dzsave.c:903 msgid "Tile size" msgstr "" -#: ../libvips/foreign/dzsave.c:897 +#: ../libvips/foreign/dzsave.c:904 msgid "Tile size in pixels" msgstr "" diff --git a/tools/batch_crop.in b/tools/batch_crop.in index 982b9e66..414b18b4 100644 --- a/tools/batch_crop.in +++ b/tools/batch_crop.in @@ -12,14 +12,9 @@ VIPSHOME=${VIPSHOME-@prefix@} name=`basename $0` -left=$1 -top=$2 -width=$3 -height=$4 -shift 4 # check args -if [ $# -lt 1 ]; then +if [ $# -lt 5 ]; then echo "usage: $name left top width height image1 image2 ..." echo echo "$name writes a new set of images called crop_image1, " @@ -28,6 +23,12 @@ if [ $# -lt 1 ]; then exit 1 fi +left=$1 +top=$2 +width=$3 +height=$4 +shift 4 + # convert each argument for i in $*; do dir=`dirname $i` diff --git a/tools/batch_image_convert.in b/tools/batch_image_convert.in index e4fff85a..b72865b1 100644 --- a/tools/batch_image_convert.in +++ b/tools/batch_image_convert.in @@ -12,11 +12,9 @@ VIPSHOME=${VIPSHOME-@prefix@} name=`basename $0` -type=$1 -shift # check args -if [ $# -lt 1 ]; then +if [ $# -lt 2 ]; then echo "usage: $name image1 image2 ..." echo echo "$name uses VIPS to convert a group of image files of" @@ -27,6 +25,9 @@ if [ $# -lt 1 ]; then exit 1 fi +type=$1 +shift + # convert each argument for i in $*; do # drop the suffix on the filename diff --git a/tools/batch_rubber_sheet.in b/tools/batch_rubber_sheet.in index d36891f9..d12f1286 100644 --- a/tools/batch_rubber_sheet.in +++ b/tools/batch_rubber_sheet.in @@ -14,11 +14,9 @@ VIPSHOME=${VIPSHOME-@prefix@} # get name we were run as name=`basename $0` -rec=$1 -shift # check args -if [ $# -lt 1 ]; then +if [ $# -lt 2 ]; then echo "usage: $name matrix image1 image2 ..." echo "writes rsc_image1, rsc_image2, ..." echo @@ -28,6 +26,9 @@ if [ $# -lt 1 ]; then exit 1 fi +rec=$1 +shift + # transform each argument for i in $*; do echo "Transforming $i to rsc_$i ..." diff --git a/tools/vips.c b/tools/vips.c index 0176f63a..6f76749e 100644 --- a/tools/vips.c +++ b/tools/vips.c @@ -905,6 +905,20 @@ print_cppdefs( int argc, char **argv ) return( 0 ); } +static void action_list( VipsBuf *buf ); + +static int +print_help( int argc, char **argv ) +{ + char txt[1024]; + VipsBuf buf = VIPS_BUF_STATIC( txt ); + + action_list( &buf ); + printf( "%s", vips_buf_all( &buf ) ); + + return( 0 ); +} + /* All our built-in actions. */ @@ -930,11 +944,28 @@ static ActionEntry actions[] = { &empty_options[0], print_cppdefs }, { "links", N_( "generate links for vips/bin" ), &empty_options[0], print_links }, + { "help", N_( "list possible actions" ), + &empty_options[0], print_help }, }; +static void +action_list( VipsBuf *buf ) +{ + int i; + + vips_buf_appends( buf, _( "possible actions:\n" ) ); + for( i = 0; i < VIPS_NUMBER( actions ); i++ ) + vips_buf_appendf( buf, "%7s - %s\n", + actions[i].name, _( actions[i].description ) ); + vips_buf_appendf( buf, "%7s - %s\n", + "OP", _( "execute vips operation OP" ) ); +} + static void parse_options( GOptionContext *context, int *argc, char **argv ) { + char txt[1024]; + VipsBuf buf = VIPS_BUF_STATIC( txt ); GError *error = NULL; int i, j; @@ -944,6 +975,9 @@ parse_options( GOptionContext *context, int *argc, char **argv ) printf( "%d) %s\n", i, argv[i] ); #endif /*DEBUG*/ + action_list( &buf ); + g_option_context_set_summary( context, vips_buf_all( &buf ) ); + if( !g_option_context_parse( context, argc, &argv, &error ) ) { if( error ) { fprintf( stderr, "%s\n", error->message ); @@ -1128,13 +1162,7 @@ main( int argc, char **argv ) if( action && !handled ) { - printf( "%s", _( "possible actions:\n" ) ); - for( i = 0; i < VIPS_NUMBER( actions ); i++ ) - printf( "%10s - %s\n", - actions[i].name, _( actions[i].description ) ); - printf( "%10s - %s\n", - "", _( "execute named vips operation" ) ); - + print_help( argc, argv ); error_exit( _( "unknown action \"%s\"" ), action ); } diff --git a/tools/vipsthumbnail.c b/tools/vipsthumbnail.c index 17e0cc0b..a04d333c 100644 --- a/tools/vipsthumbnail.c +++ b/tools/vipsthumbnail.c @@ -31,6 +31,8 @@ * - remove "--nodelete" option, have a --delete option instead, off by * default * - much more gentle extra sharpening + * 13/11/12 + * - allow absolute paths in -o (thanks fuho) */ #ifdef HAVE_CONFIG_H @@ -306,25 +308,35 @@ thumbnail3( IMAGE *in, IMAGE *out ) static char * make_thumbnail_name( const char *filename ) { - char *dir; char *file; char *p; char buf[FILENAME_MAX]; char *result; - dir = g_path_get_dirname( filename ); file = g_path_get_basename( filename ); + /* Remove the suffix from the file portion. + */ if( (p = strrchr( file, '.' )) ) *p = '\0'; + /* output_format can be an absolute path, in which case we discard the + * path from the incoming file. + */ im_snprintf( buf, FILENAME_MAX, output_format, file ); - result = g_build_filename( dir, buf, NULL ); + if( g_path_is_absolute( output_format ) ) + result = g_strdup( buf ); + else { + char *dir; + + dir = g_path_get_dirname( filename ); + result = g_build_filename( dir, buf, NULL ); + g_free( dir ); + } if( verbose ) - printf( "thumbnailing %s as %s\n", filename, buf ); + printf( "thumbnailing %s as %s\n", filename, result ); - g_free( dir ); g_free( file ); return( result );