Commit 20f37088 authored by Bastien Nocera's avatar Bastien Nocera Committed by Germán Poo-Caamaño

libdocument: Error out early with unsupported content

No need to try loading the file through the decompressing loader if the
contents inside the document is known to be unsupported. This changes
the error message for loading WebP comics from:
Error loading document: File type Zip archive (application/zip) is not supported
to:
Error loading document: No supported images in archive
parent 146df384
Pipeline #24397 passed with stage
in 15 minutes and 26 seconds
......@@ -317,7 +317,8 @@ ev_document_factory_get_document_full (const char *uri,
if (result == FALSE || err) {
if (err &&
g_error_matches (err, EV_DOCUMENT_ERROR, EV_DOCUMENT_ERROR_ENCRYPTED)) {
(g_error_matches (err, EV_DOCUMENT_ERROR, EV_DOCUMENT_ERROR_ENCRYPTED) ||
g_error_matches (err, EV_DOCUMENT_ERROR, EV_DOCUMENT_ERROR_UNSUPPORTED_CONTENT))) {
g_propagate_error (error, err);
return document;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment