From aa726e400fcfed88c76da51122295493b617ceee Mon Sep 17 00:00:00 2001 From: Sebastian K Date: Mon, 30 Oct 2023 20:25:21 +0100 Subject: [PATCH] cleanup --- examples/src/bin/add_image.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/src/bin/add_image.rs b/examples/src/bin/add_image.rs index 32b24f19..1ca4632c 100644 --- a/examples/src/bin/add_image.rs +++ b/examples/src/bin/add_image.rs @@ -1,11 +1,9 @@ -use std::{path::PathBuf, io::BufReader, fs::File, error::Error}; +use std::{path::PathBuf, error::Error}; use pdf::{ - error::PdfError, file::FileOptions, object::*, - build::*, - primitive::{PdfString, Name}, enc::{StreamFilter, DCTDecodeParams}, content::{Op, Matrix, Content}, + primitive::Name, enc::{StreamFilter, DCTDecodeParams}, content::{Op, Matrix, Content}, }; use clap::Parser; @@ -41,7 +39,7 @@ fn main() -> Result<(), Box> { let args = Args::parse(); let img_data = std::fs::read(&args.image)?; - let img = ImageReader::new(Cursor::new(&img_data)).with_guessed_format()?.decode()?; + let img = ImageReader::with_format(Cursor::new(&img_data), image::ImageFormat::Jpeg).decode()?; let image_dict = ImageDict { width: img.width(), height: img.height(),