diff options
author | Liav A <liavalb@gmail.com> | 2023-01-15 21:50:32 +0200 |
---|---|---|
committer | Jelle Raaijmakers <jelle@gmta.nl> | 2023-01-18 21:48:35 +0100 |
commit | 649f78d0a4475a640ad353e1e879a7bb27db222b (patch) | |
tree | 5ef6f843a86a8c9aad5d76d180dc8c5d87ee2065 /Userland/Applications | |
parent | 9f2d4d3fd590177c3b6615c18ae5ec7febdb1522 (diff) | |
download | serenity-649f78d0a4475a640ad353e1e879a7bb27db222b.zip |
LibGfx+Ladybird+Userland: Don't sniff for TGA images with only raw bytes
Because TGA images don't have magic bytes as a signature to be detected,
instead assume a sequence of ReadonlyBytes is a possible TGA image only
if we are given a path so we could check the extension of the file and
see if it's a TGA image.
When we know the path of the file being loaded, we will try to first
check its extension, and only if there's no match to a known decoder,
based on simple extension lookup, then we would probe for other formats
as usual with the normal sniffing method.
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/ImageViewer/ViewWidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Applications/ImageViewer/ViewWidget.cpp b/Userland/Applications/ImageViewer/ViewWidget.cpp index 258b053d10..44c4ccb774 100644 --- a/Userland/Applications/ImageViewer/ViewWidget.cpp +++ b/Userland/Applications/ImageViewer/ViewWidget.cpp @@ -168,7 +168,7 @@ void ViewWidget::load_from_file(DeprecatedString const& path) // Spawn a new ImageDecoder service process and connect to it. auto client = ImageDecoderClient::Client::try_create().release_value_but_fixme_should_propagate_errors(); - auto decoded_image_or_error = client->decode_image(mapped_file.bytes()); + auto decoded_image_or_error = client->decode_image_with_known_path(path, mapped_file.bytes()); if (!decoded_image_or_error.has_value()) { show_error(); return; |