]> www.fi.muni.cz Git - evince.git/blobdiff - thumbnailer/evince-thumbnailer.c
Cleanup mime type detection on document load. Fix for the bug #336448.
[evince.git] / thumbnailer / evince-thumbnailer.c
index 8c79ae92db73228760a904a9e19c61efd1ce86b6..1c0ba0b4e1aa95bb823ceb8ef0f0437abfc9a934 100644 (file)
@@ -36,22 +36,23 @@ evince_thumbnail_pngenc_get (const char *uri, const char *thumbnail, int size)
        EvDocument *document = NULL;
        GError *error = NULL;
        GdkPixbuf *pixbuf;
-       char *mime_type = NULL;
 
-       document = ev_document_factory_get_document  (uri, &mime_type, &error);
+       document = ev_document_factory_get_document  (uri, &error);
 
-       if (document == NULL || error) {
-               return FALSE;
-       }
-
-       if (!ev_document_load (document, uri, &error)) {
+       if (error) {
                if (error->domain == EV_DOCUMENT_ERROR &&
-                   error->code == EV_DOCUMENT_ERROR_ENCRYPTED) {
+                   error->code == EV_DOCUMENT_ERROR_ENCRYPTED) {
                        /* FIXME: Create a thumb for cryp docs */
+                       g_error_free (error);
+                       return FALSE;
                }
                g_error_free (error);
                return FALSE;
        }
+       
+       if (document == NULL) {
+               return FALSE;
+       }
 
        if (!EV_IS_DOCUMENT_THUMBNAILS (document)) {
                return FALSE;