fix dzsave date attr on Windows

see

https://github.com/jcupitt/libvips/issues/157

thanks John
This commit is contained in:
John Cupitt 2014-08-18 21:30:26 +01:00
parent dfc8ade079
commit 03577ad832
2 changed files with 11 additions and 7 deletions

View File

@ -2,6 +2,7 @@
- more doc fixes
- fix similarity rotate+scale, thanks Topochicho
- fix 16-bit PNG save, thanks John
- fix dzsave date on Windows, thanks John
25/7/14 started 7.40.5
- fix a race in im_maxpos_avg()

View File

@ -45,6 +45,8 @@
* 25/6/14
* - stop on zip write >4gb, thanks bgilbert
* - save metadata, see https://github.com/jcupitt/libvips/issues/137
* 18/8/14
* - use g_ date funcs, helps Windows
*/
/*
@ -809,17 +811,13 @@ write_vips_meta( VipsForeignSaveDz *dz )
{
VipsObjectClass *class = VIPS_OBJECT_GET_CLASS( dz );
time_t now;
char time_string[50];
xmlDoc *doc;
GTimeVal now;
char *date;
char *dump;
int dump_size;
GsfOutput *out;
time( &now );
strftime( time_string, sizeof( time_string ),
"%FT%TZ", gmtime( &now ) );
if( !(doc = xmlNewDoc( (xmlChar *) "1.0" )) ) {
vips_error( class->nickname, "%s", _( "xml save error" ) );
return( -1 );
@ -830,14 +828,19 @@ write_vips_meta( VipsForeignSaveDz *dz )
xmlFreeDoc( doc );
return( -1 );
}
g_get_current_time( &now );
date = g_time_val_to_iso8601( &now );
if( set_prop( dz, doc->children, "xmlns",
"http://www.vips.ecs.soton.ac.uk/dzsave" ) ||
set_prop( dz, doc->children, "date", time_string ) ||
set_prop( dz, doc->children, "date", date ) ||
set_prop( dz, doc->children, "version", VIPS_VERSION ) ||
write_vips_properties( dz, doc->children ) ) {
g_free( date );
xmlFreeDoc( doc );
return( -1 );
}
g_free( date );
xmlDocDumpFormatMemory( doc, (xmlChar **) &dump, &dump_size, 1 );
if( !dump ) {