1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:27:35 +00:00

LibPDF: Send jpeg data down the same path as all other data

JPEG images now honor decode arrays and color spaces.
This commit is contained in:
Nico Weber 2024-01-07 22:12:20 -05:00 committed by Andreas Kling
parent d8ada20bae
commit e770cf06b0
2 changed files with 31 additions and 10 deletions

View file

@ -1124,11 +1124,6 @@ PDFErrorOr<Renderer::LoadedImage> Renderer::load_image(NonnullRefPtr<StreamObjec
component_value_decoders.empend(0.0f, 255.0f, dmin, dmax);
}
if (TRY(is_filter(CommonNames::DCTDecode))) {
// TODO: stream objects could store Variant<bytes/Bitmap> to avoid serialisation/deserialisation here
return LoadedImage { TRY(Gfx::Bitmap::create_from_serialized_bytes(image->bytes())), is_image_mask };
}
auto bitmap = MUST(Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, { width, height }));
int x = 0;
int y = 0;