switch to GDateTime
This commit is contained in:
parent
144a9c48f9
commit
3ba0b285d4
10
configure.ac
10
configure.ac
@ -485,6 +485,16 @@ PKG_CHECK_MODULES(MONOTONIC, glib-2.0 >= 2.28,
|
||||
]
|
||||
)
|
||||
|
||||
# from 2.62 we have datetime
|
||||
PKG_CHECK_MODULES(DATE_TIME_FORMAT_ISO8601, glib-2.0 >= 2.62,
|
||||
[AC_DEFINE(HAVE_DATE_TIME_FORMAT_ISO8601,1,
|
||||
[define if your glib has g_date_time_format_iso8601().]
|
||||
)
|
||||
],
|
||||
[:
|
||||
]
|
||||
)
|
||||
|
||||
# the old threading system
|
||||
PKG_CHECK_MODULES(GTHREAD, gthread-2.0)
|
||||
PACKAGES_USED="$PACKAGES_USED gthread-2.0"
|
||||
|
@ -1132,14 +1132,28 @@ char *
|
||||
build_scan_properties( VipsImage *image )
|
||||
{
|
||||
VipsDbuf dbuf;
|
||||
GTimeVal now;
|
||||
char *date;
|
||||
int i;
|
||||
|
||||
vips_dbuf_init( &dbuf );
|
||||
|
||||
#ifdef HAVE_DATE_TIME_FORMAT_ISO8601
|
||||
{
|
||||
GDateTime *now;
|
||||
|
||||
now = g_date_time_new_now_local();
|
||||
date = g_date_time_format_iso8601( now );
|
||||
g_date_time_unref( now );
|
||||
}
|
||||
#else /*!HAVE_DATE_TIME_FORMAT_ISO8601*/
|
||||
{
|
||||
GTimeVal now;
|
||||
|
||||
g_get_current_time( &now );
|
||||
date = g_time_val_to_iso8601( &now );
|
||||
}
|
||||
#endif /*HAVE_DATE_TIME_FORMAT_ISO8601*/
|
||||
|
||||
vips_dbuf_writef( &dbuf, "<?xml version=\"1.0\"?>\n" );
|
||||
vips_dbuf_writef( &dbuf, "<image xmlns=\"http://www.pathozoom.com/szi\""
|
||||
" date=\"%s\" version=\"1.0\">\n", date );
|
||||
|
@ -955,13 +955,27 @@ char *
|
||||
vips__xml_properties( VipsImage *image )
|
||||
{
|
||||
VipsDbuf dbuf;
|
||||
GTimeVal now;
|
||||
char *date;
|
||||
|
||||
vips_dbuf_init( &dbuf );
|
||||
|
||||
#ifdef HAVE_DATE_TIME_FORMAT_ISO8601
|
||||
{
|
||||
GDateTime *now;
|
||||
|
||||
now = g_date_time_new_now_local();
|
||||
date = g_date_time_format_iso8601( now );
|
||||
g_date_time_unref( now );
|
||||
}
|
||||
#else /*!HAVE_DATE_TIME_FORMAT_ISO8601*/
|
||||
{
|
||||
GTimeVal now;
|
||||
|
||||
g_get_current_time( &now );
|
||||
date = g_time_val_to_iso8601( &now );
|
||||
}
|
||||
#endif /*HAVE_DATE_TIME_FORMAT_ISO8601*/
|
||||
|
||||
vips_dbuf_writef( &dbuf, "<?xml version=\"1.0\"?>\n" );
|
||||
vips_dbuf_writef( &dbuf, "<image xmlns=\"%s/dzsave\" "
|
||||
"date=\"%s\" version=\"%d.%d.%d\">\n",
|
||||
|
Loading…
Reference in New Issue
Block a user