From 1899011a6c2bc0e639799f51351f601a61178e7e Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 19 Feb 2013 15:19:10 +0100 Subject: [PATCH] add some debug output --- document.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/document.c b/document.c index 11dd046..f8357e5 100644 --- a/document.c +++ b/document.c @@ -554,6 +554,7 @@ cleanup: magic_close(magic); } if (mime_type != NULL) { + girara_debug("magic detected filetype: %s\n", mime_type); return g_strdup(mime_type); } /* else fallback to g_content_type_guess method */ @@ -561,15 +562,15 @@ cleanup: gboolean uncertain = FALSE; const gchar* content_type = g_content_type_guess(path, NULL, 0, &uncertain); if (content_type == NULL) { - return NULL; + girara_debug("g_content_type failed\n"); + } else { + if (uncertain == FALSE) { + girara_debug("g_content_type detected filetype: %s\n", content_type); + return content_type; + } + girara_debug("g_content_type is uncertain, guess: %s\n", content_type); } - if (uncertain == FALSE) { - return content_type; - } - - girara_debug("g_content_type is uncertain, guess: %s\n", content_type); - FILE* f = fopen(path, "rb"); if (f == NULL) { return NULL;