Skip to content

Commit

Permalink
feat: use better filter for resize (deepzoom) (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
AzHicham authored Oct 24, 2022
1 parent 68c5443 commit 7811a66
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "openslide-rs"
edition = "2021"
version = "0.3.0"
version = "0.3.1"
authors = ["AzHicham <[email protected]>"]
description = "Rust bindings of OpenSlide C library"
repository = "https://github.com/AzHicham/openslide-rs"
Expand Down
5 changes: 3 additions & 2 deletions src/deepzoom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! This is a simple translation of python DeepZoomGenerator implementation
use crate::{errors::OpenSlideError, Address, DeepZoomGenerator, OpenSlide, Region, Result, Size};
use image::{RgbImage, RgbaImage};
use image::{imageops::FilterType, RgbImage, RgbaImage};

impl<'a> DeepZoomGenerator<'a> {
pub fn new(
Expand Down Expand Up @@ -163,10 +163,11 @@ impl<'a> DeepZoomGenerator<'a> {
};

if final_size != size {
Ok(image::imageops::thumbnail(
Ok(image::imageops::resize(
&image,
final_size.w,
final_size.h,
FilterType::Lanczos3,
))
} else {
Ok(image)
Expand Down

0 comments on commit 7811a66

Please sign in to comment.