diff options
author | Liav A <liavalb@gmail.com> | 2023-01-20 03:27:10 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-01-20 15:13:31 +0000 |
commit | 6e6999ce5767121a6904b6c36454723e39b9bf24 (patch) | |
tree | a13426f1402eaa030397c3545b694ae3683f6f2d /Userland/Libraries/LibGfx/ImageDecoder.h | |
parent | fedd18eb89db0f9a6b8047cd2a5a7d716cca9544 (diff) | |
download | serenity-6e6999ce5767121a6904b6c36454723e39b9bf24.zip |
LibGfx: Re-work the abstractions of sending image for decoding over IPC
Originally I simply thought that passing file paths is quite OK, but as
Linus pointed to, it turned out that passing file paths to ensure some
files are able to be decoded is awkward because it does not work with
images being served over HTTP.
Therefore, ideally we should just use the MIME type as an optional
argument to ensure that we can always fallback to use that in case
sniffing for the correct image type has failed so we can still detect
files like with the TGA format, which has no magic bytes.
Diffstat (limited to 'Userland/Libraries/LibGfx/ImageDecoder.h')
-rw-r--r-- | Userland/Libraries/LibGfx/ImageDecoder.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGfx/ImageDecoder.h b/Userland/Libraries/LibGfx/ImageDecoder.h index 5b0731b9a2..9d622ec8ac 100644 --- a/Userland/Libraries/LibGfx/ImageDecoder.h +++ b/Userland/Libraries/LibGfx/ImageDecoder.h @@ -47,8 +47,7 @@ protected: class ImageDecoder : public RefCounted<ImageDecoder> { public: - static RefPtr<ImageDecoder> try_create_for_raw_bytes(ReadonlyBytes); - static RefPtr<ImageDecoder> try_create_for_raw_bytes_with_known_path(StringView path, ReadonlyBytes); + static RefPtr<ImageDecoder> try_create_for_raw_bytes(ReadonlyBytes, Optional<DeprecatedString> mime_type = {}); ~ImageDecoder() = default; IntSize size() const { return m_plugin->size(); } |