[gimp/gimp-2-8] app: create thumbnails also for imported files, not only for XCFs



commit d8e71085cc4333e5dc948635dea75ec55ec23e6e
Author: Michael Natterer <mitch gimp org>
Date:   Fri Jul 13 23:50:07 2012 +0200

    app: create thumbnails also for imported files, not only for XCFs
    
    file_open_with_proc_and_display(): Use gimp_image_get_any_uri() to
    check if the opened file has the same URI as the one passed in so
    the logic works for non-XCF too.
    (cherry picked from commit afa81b5fbf753f82dd3c12c7795c38bd1aade372)

 app/file/file-open.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/app/file/file-open.c b/app/file/file-open.c
index c192777..658d078 100644
--- a/app/file/file-open.c
+++ b/app/file/file-open.c
@@ -436,13 +436,17 @@ file_open_with_proc_and_display (Gimp                *gimp,
         {
           GimpDocumentList *documents = GIMP_DOCUMENT_LIST (gimp->documents);
           GimpImagefile    *imagefile;
+          const gchar      *opened_uri;
 
           imagefile = gimp_document_list_add_uri (documents, uri, mime_type);
 
           /*  can only create a thumbnail if the passed uri and the
-           *  resulting image's uri match.
+           *  resulting image's uri match. Use any_uri() here so we
+           *  create thumbnails for both XCF and imported images.
            */
-          if (strcmp (uri, gimp_image_get_uri_or_untitled (image)) == 0)
+          opened_uri = gimp_image_get_any_uri (image);
+
+          if (opened_uri && ! strcmp (uri, opened_uri))
             {
               /*  no need to save a thumbnail if there's a good one already  */
               if (! gimp_imagefile_check_thumbnail (imagefile))



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