gthumb r2219 - in trunk: . libgthumb



Author: mjc
Date: Fri Jan 25 20:43:57 2008
New Revision: 2219
URL: http://svn.gnome.org/viewvc/gthumb?rev=2219&view=rev

Log:
2008-01-25  Michael J. Chudobiak  <mjc svn gnome org>

        * libgthumb/file-data.c: (file_data_insert_metadata):
        Don't load metadata for very new files, because they may still
        be changing, which can cause nasty problems (that is, the
        FileData structs vanish during metadata reading, etc).



Modified:
   trunk/ChangeLog
   trunk/libgthumb/file-data.c

Modified: trunk/libgthumb/file-data.c
==============================================================================
--- trunk/libgthumb/file-data.c	(original)
+++ trunk/libgthumb/file-data.c	Fri Jan 25 20:43:57 2008
@@ -324,6 +324,17 @@
 	if (fd->exif_data_loaded)
 		return;
 
+	/* Don't load metadata for very new files, because they may still
+	   be changing, which can cause nasty problems (that is, the
+	   FileData structs vanish during metadata reading, etc).
+	   We delay loading thumbnails for a similar time period, see
+	   libgthumb/thumb-loader.c:thumb_loader_start__step2.
+	   This should be improved somehow, perhaps to issue a file-changed
+	   signal to tell gthumb to try loading the metadata again in a 
+	   few seconds. */
+	if ((time (NULL) - fd->mtime) < (time_t) 5)
+		return;
+
 	fd->metadata = update_metadata (fd->metadata, fd->path, fd->mime_type);
 	fd->exif_time = get_metadata_time_from_fd (fd);
 	fd->exif_data_loaded = TRUE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]