From c98d65434b2ce57856c6a7e5227532f94075caea Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Thu, 20 Sep 2012 03:11:49 -0400 Subject: [PATCH] bump minimum OpenSlide version to 3.3.0 - Avoid deprecated API - Drop unneeded g_log handler --- configure.in | 8 ++++---- libvips/foreign/openslide2vips.c | 7 ++++--- libvips/foreign/openslideload.c | 14 +------------- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/configure.in b/configure.in index b7dcfc32..ebe1ab18 100644 --- a/configure.in +++ b/configure.in @@ -482,11 +482,11 @@ AC_ARG_WITH([openslide], AS_HELP_STRING([--without-openslide], [build without OpenSlide (default: test)])) if test x"$with_openslide" != x"no"; then - PKG_CHECK_MODULES(OPENSLIDE, openslide >= 3.2.5, - [AC_DEFINE(HAVE_OPENSLIDE,1,[define if you have OpenSlide >= 3.2.5 installed.]) + PKG_CHECK_MODULES(OPENSLIDE, openslide >= 3.3.0, + [AC_DEFINE(HAVE_OPENSLIDE,1,[define if you have OpenSlide >= 3.3.0 installed.]) with_openslide=yes PACKAGES_USED="$PACKAGES_USED openslide"], - [AC_MSG_WARN([OpenSlide >= 3.2.5 not found; disabling virtual slide support]) + [AC_MSG_WARN([OpenSlide >= 3.3.0 not found; disabling virtual slide support]) with_openslide=no ]) fi @@ -748,7 +748,7 @@ accelerate loops with orc: $with_orc ICC profile support with lcms: $with_lcms file import with OpenEXR: $with_OpenEXR file import with OpenSlide: $with_openslide - (requires openslide-3.2.5 or later) + (requires openslide-3.3.0 or later) file import with matio: $with_matio file import with cfitsio: $with_cfitsio text rendering with pangoft2: $with_pangoft2 diff --git a/libvips/foreign/openslide2vips.c b/libvips/foreign/openslide2vips.c index 6ecbfac3..3eaf405f 100644 --- a/libvips/foreign/openslide2vips.c +++ b/libvips/foreign/openslide2vips.c @@ -33,6 +33,7 @@ * - fail if both level and associated image are specified * 20/9/12 * - update openslide_open error handling for 3.3.0 semantics + * - switch from deprecated _layer_ functions */ /* @@ -187,7 +188,7 @@ readslide_new( const char *filename, VipsImage *out, } if( level < 0 || - level >= openslide_get_layer_count( rslide->osr ) ) { + level >= openslide_get_level_count( rslide->osr ) ) { vips_error( "openslide2vips", "%s", _( "invalid slide level" ) ); return( NULL ); @@ -205,9 +206,9 @@ readslide_new( const char *filename, VipsImage *out, vips_demand_hint( out, VIPS_DEMAND_STYLE_THINSTRIP, NULL ); } else { - openslide_get_layer_dimensions( rslide->osr, + openslide_get_level_dimensions( rslide->osr, level, &w, &h ); - rslide->downsample = openslide_get_layer_downsample( + rslide->downsample = openslide_get_level_downsample( rslide->osr, level ); vips_image_set_int( out, "slide-level", level ); vips_demand_hint( out, VIPS_DEMAND_STYLE_SMALLTILE, NULL ); diff --git a/libvips/foreign/openslideload.c b/libvips/foreign/openslideload.c index 6c4c5c62..5df8e850 100644 --- a/libvips/foreign/openslideload.c +++ b/libvips/foreign/openslideload.c @@ -8,6 +8,7 @@ * - convert remaining uses of "layer" to "level" * 20/9/12 * - add Leica filename suffix + * - drop glib log handler (unneeded with >= 3.3.0) */ /* @@ -133,13 +134,6 @@ vips_foreign_load_openslide_load( VipsForeignLoad *load ) return( 0 ); } -static void -vips_foreign_load_openslide_error_handler( const char *domain, - GLogLevelFlags level, const char *message, void *data ) -{ - vips_error( "openslide", "%s", message ); -} - static const char *vips_foreign_openslide_suffs[] = { ".svs", /* Aperio */ ".vms", ".vmu", ".ndpi", /* Hamamatsu */ @@ -197,12 +191,6 @@ vips_foreign_load_openslide_class_init( VipsForeignLoadOpenslideClass *class ) VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignLoadOpenslide, associated ), NULL ); - - /* Catch just openslide errors. - */ - g_log_set_handler( "Openslide", - G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING, - vips_foreign_load_openslide_error_handler, NULL ); } static void