summaryrefslogtreecommitdiff
path: root/Userland/Utilities/headless-browser.cpp
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2023-01-15 21:50:32 +0200
committerJelle Raaijmakers <jelle@gmta.nl>2023-01-18 21:48:35 +0100
commit649f78d0a4475a640ad353e1e879a7bb27db222b (patch)
tree5ef6f843a86a8c9aad5d76d180dc8c5d87ee2065 /Userland/Utilities/headless-browser.cpp
parent9f2d4d3fd590177c3b6615c18ae5ec7febdb1522 (diff)
downloadserenity-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/Utilities/headless-browser.cpp')
-rw-r--r--Userland/Utilities/headless-browser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Utilities/headless-browser.cpp b/Userland/Utilities/headless-browser.cpp
index bc5705aeb9..361413440e 100644
--- a/Userland/Utilities/headless-browser.cpp
+++ b/Userland/Utilities/headless-browser.cpp
@@ -265,7 +265,7 @@ public:
virtual Optional<Web::Platform::DecodedImage> decode_image(ReadonlyBytes data) override
{
- auto decoder = Gfx::ImageDecoder::try_create(data);
+ auto decoder = Gfx::ImageDecoder::try_create_for_raw_bytes(data);
if (!decoder)
return Web::Platform::DecodedImage { false, 0, Vector<Web::Platform::Frame> {} };