Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
s3bk committed Oct 30, 2023
1 parent a4ba26b commit aa726e4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions examples/src/bin/add_image.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -41,7 +39,7 @@ fn main() -> Result<(), Box<dyn Error>> {
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(),
Expand Down

0 comments on commit aa726e4

Please sign in to comment.