diff --git a/libvips/foreign/dzsave.c b/libvips/foreign/dzsave.c index b55cb1f7..6c362f42 100644 --- a/libvips/foreign/dzsave.c +++ b/libvips/foreign/dzsave.c @@ -720,15 +720,29 @@ write_vips_properties( VipsForeignSaveDz *dz ) { VipsForeignSave *save = (VipsForeignSave *) dz; + time_t timebuf; + char time_string[30]; GsfOutput *out; + time( &timebuf ); + ctime_r( &timebuf, time_string ); + + /* Remove the trailing \n. + */ + if( strlen( time_string ) > 0 && + time_string[strlen( time_string ) - 1] == '\n' ) + time_string[strlen( time_string ) - 1] = '\0'; + out = vips_gsf_path( dz->tree, "vips-properties.xml", dz->root_name, NULL ); gsf_output_printf( out, "\n" ); gsf_output_printf( out, "\n" ); - gsf_output_printf( out, " \n" ); + gsf_output_printf( out, " \n" ); (void) vips_image_map( save->ready, write_vips_property, out ); gsf_output_printf( out, " \n" ); gsf_output_printf( out, "\n" );