openslide needs suffs

This commit is contained in:
John Cupitt 2011-12-12 12:08:01 +00:00
parent 18d54ea3d2
commit 968c84e478
5 changed files with 16 additions and 5 deletions

1
TODO
View File

@ -1,3 +1,4 @@
- we suffs on load as well for nip2's file-open dialog

View File

@ -123,6 +123,15 @@ vips_foreign_load_openslide_error_handler( const char *domain,
vips_error( "openslide", "%s", message ); vips_error( "openslide", "%s", message );
} }
static const char *vips_foreign_openslide_suffs[] = {
".svs", /* Aperio */
".vms", ".vmu", ".ndpi", /* Hamamatsu */
".mrxs", /* MIRAX */
".tif", /* Trestle */
NULL
};
static void static void
vips_foreign_load_openslide_class_init( VipsForeignLoadOpenslideClass *class ) vips_foreign_load_openslide_class_init( VipsForeignLoadOpenslideClass *class )
{ {
@ -142,6 +151,7 @@ vips_foreign_load_openslide_class_init( VipsForeignLoadOpenslideClass *class )
* better handled by the vips tiff loader we are careful to say no. * better handled by the vips tiff loader we are careful to say no.
*/ */
foreign_class->priority = 100; foreign_class->priority = 100;
foreign_class->suffs = vips_foreign_openslide_suffs;
load_class->is_a = vips__openslide_isslide; load_class->is_a = vips__openslide_isslide;
load_class->get_flags = vips_foreign_load_openslide_get_flags; load_class->get_flags = vips_foreign_load_openslide_get_flags;

View File

@ -34,6 +34,8 @@
extern "C" { extern "C" {
#endif /*__cplusplus*/ #endif /*__cplusplus*/
extern const char *vips__foreign_tiff_suffs[];
void vips__thandler_error( const char *module, const char *fmt, va_list ap ); 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__thandler_warning( const char *module, const char *fmt, va_list ap );

View File

@ -104,7 +104,7 @@ vips_foreign_load_tiff_load( VipsForeignLoad *load )
return( 0 ); return( 0 );
} }
static const char *tiff_suffs[] = { ".tif", ".tiff", NULL }; const char *vips__foreign_tiff_suffs[] = { ".tif", ".tiff", NULL };
static void static void
vips_foreign_load_tiff_class_init( VipsForeignLoadTiffClass *class ) vips_foreign_load_tiff_class_init( VipsForeignLoadTiffClass *class )
@ -120,7 +120,7 @@ vips_foreign_load_tiff_class_init( VipsForeignLoadTiffClass *class )
object_class->nickname = "tiffload"; object_class->nickname = "tiffload";
object_class->description = _( "load tiff from file" ); object_class->description = _( "load tiff from file" );
foreign_class->suffs = tiff_suffs; foreign_class->suffs = vips__foreign_tiff_suffs;
load_class->is_a = vips__istiff; load_class->is_a = vips__istiff;
load_class->get_flags = vips_foreign_load_tiff_get_flags; load_class->get_flags = vips_foreign_load_tiff_get_flags;

View File

@ -124,8 +124,6 @@ vips_foreign_save_tiff_build( VipsObject *object )
return( 0 ); return( 0 );
} }
static const char *tiff_suffs[] = { ".tif", ".tiff", NULL };
/* Save a bit of typing. /* Save a bit of typing.
*/ */
#define UC VIPS_FORMAT_UCHAR #define UC VIPS_FORMAT_UCHAR
@ -159,7 +157,7 @@ vips_foreign_save_tiff_class_init( VipsForeignSaveTiffClass *class )
object_class->description = _( "save image to tiff file" ); object_class->description = _( "save image to tiff file" );
object_class->build = vips_foreign_save_tiff_build; object_class->build = vips_foreign_save_tiff_build;
foreign_class->suffs = tiff_suffs; foreign_class->suffs = vips__foreign_tiff_suffs;
save_class->saveable = VIPS_SAVEABLE_ANY; save_class->saveable = VIPS_SAVEABLE_ANY;
save_class->format_table = bandfmt_tiff; save_class->format_table = bandfmt_tiff;