[gvfs] Bug 585853 – video file previews



commit 3431510c410c4c97c372ac797c0507d1c7eb69bf
Author: David Zeuthen <davidz redhat com>
Date:   Mon Jun 15 20:01:59 2009 -0400

    Bug 585853 â?? video file previews
    
    Also set preview::icon for video files.

 daemon/gvfsbackendgphoto2.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/daemon/gvfsbackendgphoto2.c b/daemon/gvfsbackendgphoto2.c
index 1c2a83b..d6d6520 100644
--- a/daemon/gvfsbackendgphoto2.c
+++ b/daemon/gvfsbackendgphoto2.c
@@ -1123,13 +1123,12 @@ file_get_info (GVfsBackendGphoto2 *gphoto2_backend,
     }
   if (mime_type == NULL)
     mime_type = g_content_type_guess (name, NULL, 0, NULL);
-  if (mime_type == NULL)  
+  if (mime_type == NULL)
     mime_type = g_strdup ("application/octet-stream");
   g_file_info_set_content_type (info, mime_type);
 
-  /* assume that all JPG files, and only all JPG files, has a preview file */
-  if (strcmp (mime_type, "image/jpg") == 0 ||
-      strcmp (mime_type, "image/jpeg") == 0)
+  /* we offer thumbnails for both pics and video (see bgo #585853) */
+  if (g_str_has_prefix (mime_type, "image") || g_str_has_prefix (mime_type, "video"))
     {
       char *icon_id;
       GIcon *icon;
@@ -1739,7 +1738,8 @@ do_open_for_read_real (GVfsBackend *backend,
       goto out;
     }
 
-  DEBUG ("  data=%p size=%ld handle=%p", read_handle->data, read_handle->size, read_handle);
+  DEBUG ("  data=%p size=%ld handle=%p get_preview=%d",
+         read_handle->data, read_handle->size, read_handle, get_preview);
 
   g_mutex_lock (gphoto2_backend->lock);
   gphoto2_backend->num_open_files_for_reading++;



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