mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-01 09:46:02 +01:00
add some debug output
This commit is contained in:
parent
4446456159
commit
1899011a6c
1 changed files with 8 additions and 7 deletions
15
document.c
15
document.c
|
@ -554,6 +554,7 @@ cleanup:
|
||||||
magic_close(magic);
|
magic_close(magic);
|
||||||
}
|
}
|
||||||
if (mime_type != NULL) {
|
if (mime_type != NULL) {
|
||||||
|
girara_debug("magic detected filetype: %s\n", mime_type);
|
||||||
return g_strdup(mime_type);
|
return g_strdup(mime_type);
|
||||||
}
|
}
|
||||||
/* else fallback to g_content_type_guess method */
|
/* else fallback to g_content_type_guess method */
|
||||||
|
@ -561,15 +562,15 @@ cleanup:
|
||||||
gboolean uncertain = FALSE;
|
gboolean uncertain = FALSE;
|
||||||
const gchar* content_type = g_content_type_guess(path, NULL, 0, &uncertain);
|
const gchar* content_type = g_content_type_guess(path, NULL, 0, &uncertain);
|
||||||
if (content_type == NULL) {
|
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");
|
FILE* f = fopen(path, "rb");
|
||||||
if (f == NULL) {
|
if (f == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue