mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibPDF: Get color rendering intent from image dict
Still not used for anything, so no behavior change.
This commit is contained in:
parent
b640747116
commit
ea6fed627a
Notes:
sideshowbarker
2024-07-17 01:21:02 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/ea6fed627a Pull-request: https://github.com/SerenityOS/serenity/pull/21507
2 changed files with 7 additions and 0 deletions
|
@ -89,6 +89,7 @@
|
|||
X(Index) \
|
||||
X(Indexed) \
|
||||
X(Info) \
|
||||
X(Intent) \
|
||||
X(JBIG2Decode) \
|
||||
X(JPXDecode) \
|
||||
X(Keywords) \
|
||||
|
|
|
@ -836,6 +836,12 @@ PDFErrorOr<NonnullRefPtr<Gfx::Bitmap>> Renderer::load_image(NonnullRefPtr<Stream
|
|||
|
||||
auto color_space_object = MUST(image_dict->get_object(m_document, CommonNames::ColorSpace));
|
||||
auto color_space = TRY(get_color_space_from_document(color_space_object));
|
||||
|
||||
auto color_rendering_intent = state().color_rendering_intent;
|
||||
if (image_dict->contains(CommonNames::Intent))
|
||||
color_rendering_intent = TRY(image_dict->get_name(m_document, CommonNames::Intent))->name();
|
||||
// FIXME: Do something with color_rendering_intent.
|
||||
|
||||
auto bits_per_component = image_dict->get_value(CommonNames::BitsPerComponent).get<int>();
|
||||
if (bits_per_component != 8) {
|
||||
return Error(Error::Type::RenderingUnsupported, "Image's bit per component != 8");
|
||||
|
|
Loading…
Reference in a new issue