Skip to content

Commit 39e75e0

Browse files
committed
deprecate "properties", register ".szi" as a suff
1 parent d58b341 commit 39e75e0

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- add support for regions in C++ API [shado23]
1616
- add maxerror to gifsave [dloebl]
1717
- update libnsgif API [tlsa]
18+
- deprecate "properties" option to dzsave (now always on)
1819

1920
26/11/21 started 8.12.3
2021
- better arg checking for hist_find_ndim [travisbell]

libvips/foreign/dzsave.c

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@
9191
* - add IIIF3 layout
9292
* 21/12/21 whalehub
9393
* - remove trailing comma from IIIFv3 folder names
94+
* 29/3/22
95+
* - always write a properties file
96+
* - add .szi as a registered suffix
9497
*/
9598

9699
/*
@@ -2363,8 +2366,7 @@ vips_foreign_save_dz_build( VipsObject *object )
23632366
g_assert_not_reached();
23642367
}
23652368

2366-
if( dz->properties &&
2367-
write_vips_meta( dz ) )
2369+
if( write_vips_meta( dz ) )
23682370
return( -1 );
23692371

23702372
if( dz->container == VIPS_FOREIGN_DZ_CONTAINER_SZI &&
@@ -2440,7 +2442,7 @@ static int bandfmt_dz[10] = {
24402442
UC, C, US, S, UI, I, F, F, D, D
24412443
};
24422444

2443-
static const char *dz_suffs[] = { ".dz", NULL };
2445+
static const char *dz_suffs[] = { ".dz", ".szi", NULL };
24442446

24452447
static void
24462448
vips_foreign_save_dz_class_init( VipsForeignSaveDzClass *class )
@@ -2527,13 +2529,6 @@ vips_foreign_save_dz_class_init( VipsForeignSaveDzClass *class )
25272529
G_STRUCT_OFFSET( VipsForeignSaveDz, container ),
25282530
VIPS_TYPE_FOREIGN_DZ_CONTAINER, VIPS_FOREIGN_DZ_CONTAINER_FS );
25292531

2530-
VIPS_ARG_BOOL( class, "properties", 16,
2531-
_( "Properties" ),
2532-
_( "Write a properties file to the output directory" ),
2533-
VIPS_ARGUMENT_OPTIONAL_INPUT,
2534-
G_STRUCT_OFFSET( VipsForeignSaveDz, properties ),
2535-
FALSE );
2536-
25372532
VIPS_ARG_INT( class, "compression", 17,
25382533
_( "Compression" ),
25392534
_( "ZIP deflate compression level" ),
@@ -2593,6 +2588,13 @@ vips_foreign_save_dz_class_init( VipsForeignSaveDzClass *class )
25932588
G_STRUCT_OFFSET( VipsForeignSaveDz, tile_size ),
25942589
1, 8192, 254 );
25952590

2591+
VIPS_ARG_BOOL( class, "properties", 16,
2592+
_( "Properties" ),
2593+
_( "Write a properties file to the output directory" ),
2594+
VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED,
2595+
G_STRUCT_OFFSET( VipsForeignSaveDz, properties ),
2596+
FALSE );
2597+
25962598
}
25972599

25982600
static void
@@ -2806,7 +2808,6 @@ vips_foreign_save_dz_buffer_init( VipsForeignSaveDzBuffer *buffer )
28062808
* * @centre: %gboolean centre the tiles
28072809
* * @angle: #VipsAngle rotate the image by this much
28082810
* * @container: #VipsForeignDzContainer set container type
2809-
* * @properties: %gboolean write a properties file
28102811
* * @compression: %gint zip deflate compression level
28112812
* * @region_shrink: #VipsRegionShrink how to shrink each 2x2 region
28122813
* * @skip_blanks: %gint skip tiles which are nearly equal to the background
@@ -2845,12 +2846,6 @@ vips_foreign_save_dz_buffer_init( VipsForeignSaveDzBuffer *buffer )
28452846
* yourself with vips_rot(). Note that the `autorotate` option to the loader
28462847
* may do what you need.
28472848
*
2848-
* If @properties is %TRUE, vips_dzsave() will write a file called
2849-
* `vips-properties.xml` to the output directory. This file lists all of the
2850-
* metadata attached to @in in an obvious manner. It can be useful for viewing
2851-
* programs which wish to use fields from source files loaded via
2852-
* vips_openslideload().
2853-
*
28542849
* By default, all tiles are stripped since usually you do not want a copy of
28552850
* all metadata in every tile. Set @no_strip if you want to keep metadata.
28562851
*
@@ -2908,7 +2903,6 @@ vips_dzsave( VipsImage *in, const char *name, ... )
29082903
* * @centre: %gboolean centre the tiles
29092904
* * @angle: #VipsAngle rotate the image by this much
29102905
* * @container: #VipsForeignDzContainer set container type
2911-
* * @properties: %gboolean write a properties file
29122906
* * @compression: %gint zip deflate compression level
29132907
* * @region_shrink: #VipsRegionShrink how to shrink each 2x2 region.
29142908
* * @skip_blanks: %gint skip tiles which are nearly equal to the background

libvips/foreign/foreign.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,7 @@ vips_foreign_find_save_sub( VipsForeignSaveClass *save_class,
18521852
/* vips_foreign_find_save() has already removed any options from the
18531853
* end of the filename, so we can test directly against the suffix.
18541854
*/
1855-
for( p = class->suffs; *p; p++ )
1855+
for( p = class->suffs; *p; p++ )
18561856
if( vips_iscasepostfix( filename, *p ) )
18571857
return( save_class );
18581858

0 commit comments

Comments
 (0)