From 4db5a3b7b93f7db220602991efa3344ad2c37686 Mon Sep 17 00:00:00 2001 From: simon987 Date: Sat, 18 Jul 2020 10:28:05 -0400 Subject: [PATCH] Don't show MuPDF warnings unless --very-verbose is specified --- libscan/ebook/ebook.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libscan/ebook/ebook.c b/libscan/ebook/ebook.c index 4b9b0d6..8b6473a 100644 --- a/libscan/ebook/ebook.c +++ b/libscan/ebook/ebook.c @@ -137,12 +137,19 @@ void fz_err_callback(void *user, const char *message) { CTX_LOG_WARNINGF(doc->filepath, "FZ: %s", message); } +void fz_warn_callback(void *user, const char *message) { + document_t *doc = (document_t *) user; + + const scan_ebook_ctx_t *ctx = &thread_ctx; + CTX_LOG_DEBUGF(doc->filepath, "FZ: %s", message); +} + static void init_fzctx(fz_context *fzctx, document_t *doc) { fz_disable_icc(fzctx); fz_register_document_handlers(fzctx); fzctx->warn.print_user = doc; - fzctx->warn.print = fz_err_callback; + fzctx->warn.print = fz_warn_callback; fzctx->error.print_user = doc; fzctx->error.print = fz_err_callback; }