From 383be5e49cfc5311f71c29e355406c02ce1b9ac4 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Tue, 9 Jan 2024 21:54:51 -0500 Subject: [PATCH] LibGfx/TIFF: Override `ImageDecoderPlugin::metadata()` --- Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp | 5 +++++ Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp index 0a254e4c52a..7a04f5ba33b 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp @@ -564,6 +564,11 @@ ErrorOr TIFFImageDecoderPlugin::frame(size_t index, Option return ImageFrameDescriptor { m_context->bitmap(), 0 }; } +Optional TIFFImageDecoderPlugin::metadata() +{ + return m_context->metadata(); +} + ErrorOr> TIFFImageDecoderPlugin::icc_data() { return m_context->metadata().icc_profile().map([](auto const& buffer) -> ReadonlyBytes { return buffer.bytes(); }); diff --git a/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.h b/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.h index 93bcdf32a5d..f8f75e9dee9 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.h +++ b/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.h @@ -36,6 +36,7 @@ public: virtual ErrorOr frame(size_t index, Optional ideal_size = {}) override; + virtual Optional metadata() override; virtual ErrorOr> icc_data() override; private: