hackey hack

This commit is contained in:
John Cupitt 2014-06-06 15:03:12 +01:00
parent b394948cd1
commit 339712fb13
7 changed files with 14 additions and 10 deletions

4
TODO
View File

@ -4,7 +4,6 @@
foreign/vipsload.c uses vips_image_new_from_file() ... instead it should use
the _mode thing
- likewise, vips_image_write_to_file() should take options. Implement in terms
of vips_foreign_save()?
@ -13,6 +12,9 @@
see vips_foreign_load_buffer() for API
- do we still need all the vips_image_build() machinery? can't we just use
the foreign system?

View File

@ -91,9 +91,7 @@ vips_foreign_load_vips_header( VipsForeignLoad *load )
VipsImage *out;
VipsImage *out2;
vips_image_new_mode( filename, "r" ) );
if( !(out2 = vips_image_new_from_file( vips->filename )) )
if( !(out2 = vips_image_new_mode( vips->filename, "r" ) )
return( -1 );
/* Remove the @out that's there now.

View File

@ -417,7 +417,8 @@ void vips_image_set_kill( VipsImage *image, gboolean kill );
VipsImage *vips_image_new( void );
VipsImage *vips_image_new_mode( const char *filename, const char *mode );
VipsImage *vips_image_new_buffer( void );
VipsImage *vips_image_new_from_file( const char *filename );
VipsImage *vips_image_new_from_file( const char *filename, ... )
__attribute__((sentinel));
VipsImage *vips_image_new_from_file_raw( const char *filename,
int xsize, int ysize, int bands, guint64 offset );
VipsImage *vips_image_new_from_memory( void *buffer,
@ -428,7 +429,8 @@ void vips_image_set_delete_on_close( VipsImage *image,
gboolean delete_on_close );
VipsImage *vips_image_new_temp_file( const char *format );
int vips_image_write( VipsImage *image, VipsImage *out );
int vips_image_write_to_file( VipsImage *image, const char *filename );
int vips_image_write_to_file( VipsImage *image, const char *filename, ... )
__attribute__((sentinel));
int vips_image_decode_predict( VipsImage *im,
int *bands, VipsBandFormat *format );

View File

@ -90,7 +90,7 @@
* |[
* IMAGE *im;
*
* if( !(im = vips_image_new_from_file( filename )) )
* if( !(im = vips_image_new_from_file( filename, NULL )) )
* // vips_image_new_from_file() will set a message, we don't need to
* return( -1 );
*

View File

@ -1016,7 +1016,7 @@ vips_image_class_init( VipsImageClass *class )
gobject_class->get_property = vips_object_get_property;
vobject_class->new_from_string = vips_image_new_from_file_object;
vobject_class->to_string = vips_image_to_string;;
vobject_class->to_string = vips_image_to_string;
vobject_class->output_needs_arg = TRUE;
vobject_class->output_to_arg = vips_image_write_object;

View File

@ -221,7 +221,8 @@ vips_system_build( VipsObject *object )
if( system->out_name ) {
VipsImage *out;
if( !(out = vips_image_new_from_file( system->out_name )) )
if( !(out = vips_image_new_from_file( system->out_name,
NULL )) )
return( -1 );
vips_image_set_delete_on_close( out, TRUE );
g_object_set( system, "out", out, NULL );

View File

@ -799,7 +799,8 @@ transform_g_string_array_image( const GValue *src_value, GValue *dest_value )
str = g_value_dup_string( src_value );
for( i = 0, p = str; (q = vips_break_token( p, " " )); i++, p = q )
if( !(array[i] = G_OBJECT( vips_image_new_from_file( p ) )) ) {
if( !(array[i] = G_OBJECT( vips_image_new_from_file( p,
NULL ) )) ) {
/* Set the dest to length zero to indicate error.
*/
vips_value_set_array_object( dest_value, 0 );