diff --git a/TODO b/TODO index 06c486a9..bc555af4 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,14 @@ +- how curious + + $ vips jpegload wtc.jpg x.v --vips-progress + ** DEBUG_FATAL + vips x.v: 2 threads, 128 x 128 tiles, groups of 256 scanlines + vips /tmp/vips-1-2UERGW.v: 2 threads, 128 x 128 tiles, groups of 256 scanlines + vips /tmp/vips-1-2UERGW.v: done in 2s + vips x.v: done in 3s + memory: high-water mark 77.46 MB + + - test "rs" mode can't see the code for "rd" mode? @@ -5,19 +16,6 @@ or "rw" mode either? - -- need a flag on operations for "is sequential" - - should be on the object, not the class, since it can change with params - - use it from command-line interface - - not really helpful elsewhere, since two operations which are sequential - alone can be non-sequential in combination -- eg. shrink + conv - - can you always make sequential-apart, non-seq together pipelines seqential - by putting a line cache between each pair? - - update "how it works" to note we are now fully-functional ... there's vips_image_write() now to create a sink diff --git a/libvips/deprecated/im_analyze2vips.c b/libvips/deprecated/im_analyze2vips.c index fc9e96c8..99fbce05 100644 --- a/libvips/deprecated/im_analyze2vips.c +++ b/libvips/deprecated/im_analyze2vips.c @@ -41,6 +41,9 @@ #include +#include "../foreign/dbh.h" +#include "../foreign/analyze2vips.h" + static VipsFormatFlags analyze_flags( const char *filename ) { @@ -56,15 +59,7 @@ isanalyze( const char *filename ) int im_analyze2vips( const char *filename, IMAGE *out ) { - VipsImage *t; - - if( vips_analyzeload( filename, &t, NULL ) ) - return( -1 ); - if( vips_image_write( t, out ) ) { - g_object_unref( t ); - return( -1 ); - } - g_object_unref( t ); + return( vips__analyze_read( filename, out ) ); return( 0 ); } diff --git a/libvips/deprecated/im_csv2vips.c b/libvips/deprecated/im_csv2vips.c index 67e4fbcc..834a8792 100644 --- a/libvips/deprecated/im_csv2vips.c +++ b/libvips/deprecated/im_csv2vips.c @@ -43,6 +43,8 @@ #include +#include "../foreign/csv.h" + int im_csv2vips( const char *filename, IMAGE *out ) { @@ -56,7 +58,6 @@ im_csv2vips( const char *filename, IMAGE *out ) char name[FILENAME_MAX]; char mode[FILENAME_MAX]; char *p, *q, *r; - VipsImage *t; /* Parse mode string. */ @@ -73,18 +74,9 @@ im_csv2vips( const char *filename, IMAGE *out ) lines = atoi( r ); } - if( vips_csvload( filename, &t, - "skip", start_skip, - "lines", lines, - "whitespace", whitespace, - "separator", separator, - NULL ) ) + if( vips__csv_read( filename, out, + start_skip, lines, whitespace, separator ) ) return( -1 ); - if( vips_image_write( t, out ) ) { - g_object_unref( t ); - return( -1 ); - } - g_object_unref( t ); return( 0 ); } diff --git a/libvips/deprecated/im_exr2vips.c b/libvips/deprecated/im_exr2vips.c index 64956cfd..639e9c26 100644 --- a/libvips/deprecated/im_exr2vips.c +++ b/libvips/deprecated/im_exr2vips.c @@ -48,20 +48,12 @@ #include #include +#include "../foreign/openexr2vips.h" + int im_exr2vips( const char *filename, IMAGE *out ) { - VipsImage *t; - - if( vips_openexrload( filename, &t, NULL ) ) - return( -1 ); - if( vips_image_write( t, out ) ) { - g_object_unref( t ); - return( -1 ); - } - g_object_unref( t ); - - return( 0 ); + return( vips__openexr_read( filename, out ) ); } static const char *exr_suffs[] = { ".exr", NULL }; diff --git a/libvips/deprecated/im_jpeg2vips.c b/libvips/deprecated/im_jpeg2vips.c index e7a70485..64da7d57 100644 --- a/libvips/deprecated/im_jpeg2vips.c +++ b/libvips/deprecated/im_jpeg2vips.c @@ -2,6 +2,8 @@ * * 30/11/11 * - now just a stub + * 10/7/12 + * - use jpeg funcs directly rather than going though vips_jpegload() */ /* @@ -44,6 +46,11 @@ #include +#include +#include +#include +#include "../foreign/jpeg.h" + int im_jpeg2vips( const char *name, IMAGE *out ) { @@ -52,8 +59,6 @@ im_jpeg2vips( const char *name, IMAGE *out ) char *p, *q; int shrink; gboolean fail_on_warn; - gboolean sequential; - VipsImage *t; /* By default, we ignore any warnings. We want to get as much of * the user's data as we can. @@ -65,7 +70,6 @@ im_jpeg2vips( const char *name, IMAGE *out ) im_filename_split( name, filename, mode ); p = &mode[0]; shrink = 1; - sequential = FALSE; if( (q = im_getnextoption( &p )) ) { shrink = atoi( q ); @@ -80,24 +84,22 @@ im_jpeg2vips( const char *name, IMAGE *out ) if( im_isprefix( "fail", q ) ) fail_on_warn = TRUE; } + + /* vips__jpeg_read_file() is always sequential. Parse the option, but + * don't use it. + */ if( (q = im_getnextoption( &p )) ) { if( im_isprefix( "seq", q ) ) - sequential = TRUE; + ; } - if( vips_jpegload( filename, &t, - "shrink", shrink, - "fail", fail_on_warn, - "sequential", sequential, - NULL ) ) + /* Don't use vips_jpegload() ... we call the jpeg func directly in + * order to avoid the foreign.c mechanisms for load-via-disc and stuff + * like that. + */ + if( vips__jpeg_read_file( filename, out, FALSE, shrink, fail_on_warn ) ) return( -1 ); - if( vips_image_write( t, out ) ) { - g_object_unref( t ); - return( -1 ); - } - g_object_unref( t ); - return( 0 ); } diff --git a/libvips/deprecated/im_magick2vips.c b/libvips/deprecated/im_magick2vips.c index 9206b917..2cedd961 100644 --- a/libvips/deprecated/im_magick2vips.c +++ b/libvips/deprecated/im_magick2vips.c @@ -41,20 +41,12 @@ #include +#include "../foreign/magick.h" + int im_magick2vips( const char *filename, IMAGE *out ) { - VipsImage *t; - - if( vips_magickload( filename, &t, NULL ) ) - return( -1 ); - if( vips_image_write( t, out ) ) { - g_object_unref( t ); - return( -1 ); - } - g_object_unref( t ); - - return( 0 ); + return( vips__magick_read( filename, out ) ); } static int diff --git a/libvips/deprecated/im_png2vips.c b/libvips/deprecated/im_png2vips.c index 5d5833c1..cb9e7eab 100644 --- a/libvips/deprecated/im_png2vips.c +++ b/libvips/deprecated/im_png2vips.c @@ -44,35 +44,26 @@ #include #include +#include "../foreign/vipspng.h" + int im_png2vips( const char *name, IMAGE *out ) { char filename[FILENAME_MAX]; char mode[FILENAME_MAX]; char *p, *q; - gboolean sequential; - VipsImage *x; im_filename_split( name, filename, mode ); - sequential = FALSE; p = &mode[0]; if( (q = im_getnextoption( &p )) ) { if( im_isprefix( "seq", q ) ) - sequential = TRUE; + ; } - if( vips_pngload( filename, &x, - "sequential", sequential, - NULL ) ) + if( vips__png_read( filename, out ) ) return( -1 ); - if( vips_image_write( x, out ) ) { - g_object_unref( x ); - return( -1 ); - } - g_object_unref( x ); - return( 0 ); } diff --git a/libvips/deprecated/im_tiff2vips.c b/libvips/deprecated/im_tiff2vips.c index b9076b82..dd54c41c 100644 --- a/libvips/deprecated/im_tiff2vips.c +++ b/libvips/deprecated/im_tiff2vips.c @@ -48,6 +48,8 @@ #include #include +#include "../foreign/tiff.h" + int im_tiff2vips( const char *name, IMAGE *out ) { @@ -55,32 +57,21 @@ im_tiff2vips( const char *name, IMAGE *out ) char mode[FILENAME_MAX]; char *p, *q; int page; - gboolean sequential; - VipsImage *t; im_filename_split( name, filename, mode ); page = 0; - sequential = FALSE; p = &mode[0]; if( (q = im_getnextoption( &p )) ) { page = atoi( q ); } if( (q = im_getnextoption( &p )) ) { if( im_isprefix( "seq", q ) ) - sequential = TRUE; + ; } - if( vips_tiffload( filename, &t, - "page", page, - "sequential", sequential, - NULL ) ) + if( vips__tiff_read( filename, out, page ) ) return( -1 ); - if( vips_image_write( t, out ) ) { - g_object_unref( t ); - return( -1 ); - } - g_object_unref( t ); return( 0 ); }