|
|
@ -22,7 +22,7 @@
|
|
|
|
use crate::error::ThumbResult;
|
|
|
|
use crate::error::ThumbResult;
|
|
|
|
use image;
|
|
|
|
use image;
|
|
|
|
use image::imageops::FilterType;
|
|
|
|
use image::imageops::FilterType;
|
|
|
|
use image::{DynamicImage, ImageOutputFormat};
|
|
|
|
use image::{DynamicImage, GenericImageView, ImageOutputFormat};
|
|
|
|
use mime::Mime;
|
|
|
|
use mime::Mime;
|
|
|
|
use rayon::prelude::*;
|
|
|
|
use rayon::prelude::*;
|
|
|
|
use std::io::{BufRead, Seek, Write};
|
|
|
|
use std::io::{BufRead, Seek, Write};
|
|
|
@ -55,6 +55,11 @@ impl Thumbnail {
|
|
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
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
|
|
|
|
/// Creates thumbnails of the requested sizes for the given reader providing the content as bytes and
|
|
|
|