file-info: Add a G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID attribute

This indicates whether the thumbnail (given by G_FILE_ATTRIBUTE_THUMBNAIL_PATH)
is valid — i.e. to represent the file in its current state. If
G_FILE_ATTRIBUTE_THUMBNAIL_IS_VALID is FALSE (for a normal _or_ failed
thumbnail) it means the file has changed since the thumbnail was generated, and
the thumbnail is out of date.

Part of checking thumbnail validity (by the spec) involves parsing
headers out of the thumbnail .png so we include some (small) code to do
that in a separate file.  We will likely want to copy this code to gvfs
to do the same for GVfsFile.

Heavily based on a patch from Philip Withnall <philip.withnall@collabora.co.uk>
who suggested the feature and designed the API.

https://bugzilla.gnome.org/show_bug.cgi?id=709898
This commit is contained in:
Ryan Lortie
2013-10-11 11:22:31 +01:00
parent 38dc8d4cd3
commit fe7069749f
10 changed files with 335 additions and 11 deletions

View File

@@ -81,7 +81,8 @@ IGNORE_HFILES = \
gwin32appinfo.h \
gwin32mount.h \
gwin32resolver.h \
gwin32volumemonitor.h
gwin32volumemonitor.h \
thumbnail-verify.h
# CFLAGS and LDFLAGS for compiling scan program. Only needed