metadata: Drop unreliable mime-type

Only use a reliable mime-type. This requires that we load images earlier
in the pipe.

This also fixes warnings about mime types not being available on network
drives like SMB.

Fixes #513
Issue #534
This commit is contained in:
Sophie Herold 2025-12-03 22:35:13 +01:00
parent 40d68e898d
commit 3b11b0534e
8 changed files with 57 additions and 68 deletions

View file

@ -231,7 +231,7 @@ impl LpImagePage {
imp.stack.set_visible_child(&*imp.error_page);
imp.error_more_info.set_visible(false);
} else if image.specific_error() == DecoderError::UnsupportedFormat {
let mime_type = image.metadata().unreliable_mime_type().unwrap_or_default();
let mime_type = image.metadata().mime_type().unwrap_or_default();
let content_type = gio::content_type_from_mime_type(&mime_type).unwrap_or_default();
let description = gio::content_type_get_description(&content_type).to_string();