diff --git a/Cargo.toml b/Cargo.toml index 14437ab..de75089 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ readme = "README.md" license = "Apache-2.0" authors = ["trivernis "] description = "An image thumbnail creation library" -version = "0.2.4" +version = "0.2.5" edition = "2018" repository = "https://github.com/Trivernis/thumbnailer" diff --git a/src/lib.rs b/src/lib.rs index d723e1b..891ad4f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,7 +22,7 @@ use crate::error::ThumbResult; use image; use image::imageops::FilterType; -use image::{DynamicImage, ImageOutputFormat}; +use image::{DynamicImage, GenericImageView, ImageOutputFormat}; use mime::Mime; use rayon::prelude::*; use std::io::{BufRead, Seek, Write}; @@ -55,6 +55,11 @@ impl Thumbnail { Ok(()) } + + /// Returns the size of the thumbnail as width, height + pub fn size(&self) -> (u32, u32) { + self.inner.dimensions() + } } /// Creates thumbnails of the requested sizes for the given reader providing the content as bytes and