LibGfx/TIFF: Override ImageDecoderPlugin::metadata()

This commit is contained in:
Lucas CHOLLET 2024-01-09 21:54:51 -05:00 committed by Andrew Kaster
parent 48347d1923
commit 383be5e49c
Notes: sideshowbarker 2024-07-17 18:23:22 +09:00
2 changed files with 6 additions and 0 deletions

View File

@ -564,6 +564,11 @@ ErrorOr<ImageFrameDescriptor> TIFFImageDecoderPlugin::frame(size_t index, Option
return ImageFrameDescriptor { m_context->bitmap(), 0 };
}
Optional<Metadata const&> TIFFImageDecoderPlugin::metadata()
{
return m_context->metadata();
}
ErrorOr<Optional<ReadonlyBytes>> TIFFImageDecoderPlugin::icc_data()
{
return m_context->metadata().icc_profile().map([](auto const& buffer) -> ReadonlyBytes { return buffer.bytes(); });

View File

@ -36,6 +36,7 @@ public:
virtual ErrorOr<ImageFrameDescriptor> frame(size_t index, Optional<IntSize> ideal_size = {}) override;
virtual Optional<Metadata const&> metadata() override;
virtual ErrorOr<Optional<ReadonlyBytes>> icc_data() override;
private: