fix radsave

oop, suffix was being set ono the base class
This commit is contained in:
John Cupitt 2016-05-24 07:55:30 +01:00
parent fa8a91ea72
commit 0c28fc71d6
3 changed files with 10 additions and 9 deletions

View File

@ -8,6 +8,7 @@
- restore BandFmt on unpremultiply in vipsthumbnail
- better python detection and build [Felix Bünemann]
- max-alpha defaults to 65535 for RGB16/GREY16
- added radsave_buffer [Henri Chain]
18/5/16 started 8.3.2
- more robust vips image reading

View File

@ -1311,9 +1311,10 @@ vips__rad_save( VipsImage *in, const char *filename )
return( -1 );
write->filename = vips_strdup( NULL, filename );
write->fout = vips__file_open_write( filename, FALSE );
write->fout = vips__file_open_write( filename, FALSE );
if( !write->filename || !write->fout ||
if( !write->filename ||
!write->fout ||
vips2rad_put_header( write ) ||
vips2rad_put_data( write ) ) {
write_destroy_file( write );

View File

@ -87,7 +87,6 @@ vips_foreign_save_rad_class_init( VipsForeignSaveRadClass *class )
{
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
VipsObjectClass *object_class = (VipsObjectClass *) class;
VipsForeignClass *foreign_class = (VipsForeignClass *) class;
VipsForeignSaveClass *save_class = (VipsForeignSaveClass *) class;
gobject_class->set_property = vips_object_set_property;
@ -96,8 +95,6 @@ vips_foreign_save_rad_class_init( VipsForeignSaveRadClass *class )
object_class->nickname = "radsave_base";
object_class->description = _( "save Radiance" );
foreign_class->suffs = vips__rad_suffs;
save_class->saveable = VIPS_SAVEABLE_RGB;
save_class->format_table = vips_foreign_save_rad_format_table;
save_class->coding[VIPS_CODING_NONE] = FALSE;
@ -125,13 +122,13 @@ static int
vips_foreign_save_rad_file_build( VipsObject *object )
{
VipsForeignSave *save = (VipsForeignSave *) object;
VipsForeignSaveRadFile *rad_file = (VipsForeignSaveRadFile *) object;
VipsForeignSaveRadFile *file = (VipsForeignSaveRadFile *) object;
if( VIPS_OBJECT_CLASS( vips_foreign_save_rad_file_parent_class )->
build( object ) )
return( -1 );
if( vips__rad_save( save->ready, rad_file->filename ) )
if( vips__rad_save( save->ready, file->filename ) )
return( -1 );
return( 0 );
@ -142,10 +139,13 @@ vips_foreign_save_rad_file_class_init( VipsForeignSaveRadFileClass *class )
{
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
VipsObjectClass *object_class = (VipsObjectClass *) class;
VipsForeignClass *foreign_class = (VipsForeignClass *) class;
gobject_class->set_property = vips_object_set_property;
gobject_class->get_property = vips_object_get_property;
foreign_class->suffs = vips__rad_suffs;
object_class->nickname = "radsave";
object_class->description = _( "save image to Radiance file" );
object_class->build = vips_foreign_save_rad_file_build;
@ -260,7 +260,6 @@ vips_radsave( VipsImage *in, const char *filename, ... )
* @len: return output length here
* @...: %NULL-terminated list of optional named arguments
*
*
* As vips_radsave(), but save to a memory buffer.
*
* The address of the buffer is returned in @obuf, the length of the buffer in
@ -297,4 +296,4 @@ vips_radsave_buffer( VipsImage *in, void **buf, size_t *len, ... )
}
return( result );
}
}