Skip to content

Use microsecond precision for last modification time

Fixes #15 (closed).

When the file system allows it, this prevents Tumbler from believing that the original file has not been modified since the last time the thumbnail was created, when in fact modifications have taken place in the second that the thumbnail was created.

The time of last modification is stored internally in a gdouble, and written to the PNG thumbnail in %.6f format. This complies well with the Freedesktop specification, as the stat command returns this format when invoked as stat -c%.6Y file, although it is likely that the specification was written with the idea that this value be an integer.

The extraction of the thumbnail information is done via g_ascii_strtod(), so an integer or less precision is not a problem. As for a code expecting to find an integer, it is likely to simply ignore the decimal part, as Tumbler used to do by extracting the information via atol(). It is possible, however, that an error will be found if a more complete extractor is used, such as strtol().

The changes this causes to the exposed Tumbler APIs should also be inconsequential, as it is a conversion to a higher type. This should therefore result in implicit conversions, except perhaps for tumbler_file_info_get_mtime(), if its return value is explicitly stored in a gint64.

Edited by Gaël Bonithon

Merge request reports