summaryrefslogtreecommitdiff
path: root/src/export/pdf
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-12-12 10:35:42 +0100
committerLaurenz <laurmaedje@gmail.com>2022-12-12 10:35:42 +0100
commit2271d67f8f5fe65882e74622ad01c075102725b1 (patch)
tree8753166a1940ea75aed3371ccc4f463465b4e0f7 /src/export/pdf
parentc38d55614af0226be8eb3f3e1500da8b7be2fec8 (diff)
Faster image rendering
Diffstat (limited to 'src/export/pdf')
-rw-r--r--src/export/pdf/image.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/export/pdf/image.rs b/src/export/pdf/image.rs
index e507a613..78731734 100644
--- a/src/export/pdf/image.rs
+++ b/src/export/pdf/image.rs
@@ -17,10 +17,10 @@ pub fn write_images(ctx: &mut PdfContext) {
// Add the primary image.
// TODO: Error if image could not be encoded.
- match image.decode().unwrap() {
+ match image.decode().unwrap().as_ref() {
DecodedImage::Raster(dynamic, format) => {
// TODO: Error if image could not be encoded.
- let (data, filter, has_color) = encode_image(format, &dynamic).unwrap();
+ let (data, filter, has_color) = encode_image(*format, &dynamic).unwrap();
let mut image = ctx.writer.image_xobject(image_ref, &data);
image.filter(filter);
image.width(width as i32);