[Xfce4-commits] <thunar:master> Only collect image data if the mime-type is image/* (bug #2913).

Nick Schermer noreply at xfce.org
Fri Sep 28 21:12:01 CEST 2012


Updating branch refs/heads/master
         to d9129c8d59aecd3923e49db23266b271b50776b8 (commit)
       from ae5f4024ea255d762627babcbdff967d722bbb6a (commit)

commit d9129c8d59aecd3923e49db23266b271b50776b8
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Sep 28 21:09:46 2012 +0200

    Only collect image data if the mime-type is image/* (bug #2913).
    
    Bit of a rough check, but it should be save. Invalid or empy svg files
    are not detected as image/svg+xml.
    Another advantage is that not all files are loaded to check if
    it is an image, only files that look like images.

 thunar/thunar-list-model.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/thunar/thunar-list-model.c b/thunar/thunar-list-model.c
index 940bd99..f76f648 100644
--- a/thunar/thunar-list-model.c
+++ b/thunar/thunar-list-model.c
@@ -2388,6 +2388,7 @@ thunar_list_model_get_statusbar_text (ThunarListModel *store,
           /* check if we can determine the dimension of this file (only for image files) */
           absolute_path = g_file_get_path (thunar_file_get_file (file));
           if (absolute_path != NULL
+              && g_str_has_prefix (thunar_file_get_content_type (file), "image/") /* bug #2913 */
               && gdk_pixbuf_get_file_info (absolute_path, &width, &height) != NULL)
             {
               /* append the image dimensions to the statusbar text */


More information about the Xfce4-commits mailing list