mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:07:36 +00:00
LibPDF: Tolerate integer outline item colors
0000296.pdf from 0000.zip from the pdfa dataset contains `/C [0 0 0]` (as opposed to `/C [0.0 0.0 0.0]`). Make that work. (It's fine per spec.)
This commit is contained in:
parent
c2c37de201
commit
208a058eab
1 changed files with 3 additions and 3 deletions
|
@ -568,9 +568,9 @@ PDFErrorOr<NonnullRefPtr<OutlineItem>> Document::build_outline_item(NonnullRefPt
|
|||
|
||||
if (outline_item_dict->contains(CommonNames::C)) {
|
||||
auto color_array = TRY(outline_item_dict->get_array(this, CommonNames::C));
|
||||
auto r = static_cast<int>(255.0f * color_array->at(0).get<float>());
|
||||
auto g = static_cast<int>(255.0f * color_array->at(1).get<float>());
|
||||
auto b = static_cast<int>(255.0f * color_array->at(2).get<float>());
|
||||
auto r = static_cast<int>(255.0f * color_array->at(0).to_float());
|
||||
auto g = static_cast<int>(255.0f * color_array->at(1).to_float());
|
||||
auto b = static_cast<int>(255.0f * color_array->at(2).to_float());
|
||||
outline_item->color = Color(r, g, b);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue