1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:47:34 +00:00

LibGfx/TIFF: Add support for the ICCProfile tag

This commit is contained in:
Lucas CHOLLET 2023-11-28 21:16:43 -05:00 committed by Andreas Kling
parent 5622e7d77c
commit 4994609af0
5 changed files with 26 additions and 0 deletions

View file

@ -55,6 +55,11 @@ public:
return { *m_metadata.image_width(), *m_metadata.image_height() };
}
Metadata const& metadata() const
{
return m_metadata;
}
State state() const
{
return m_state;
@ -482,6 +487,12 @@ ErrorOr<ImageFrameDescriptor> TIFFImageDecoderPlugin::frame(size_t index, Option
return ImageFrameDescriptor { m_context->bitmap(), 0 };
}
ErrorOr<Optional<ReadonlyBytes>> TIFFImageDecoderPlugin::icc_data()
{
return m_context->metadata().icc_profile().map([](auto const& buffer) -> ReadonlyBytes { return buffer.bytes(); });
}
}
template<typename T>