Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Clippy] Code maintenance #159

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{Result, Size};
use crate::{errors::ImageError, Result, Size};
use fast_image_resize as fr;
use image::RgbImage;
use std::cmp;
use {crate::errors::ImageError, image::RgbImage};

// Get the appropriate level for the given dimensions: i.e. the level with at least one
// dimensions (i.e along one axis) greater than the dimension requested
Expand Down
4 changes: 2 additions & 2 deletions src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl<'a> View<'a> {
pub fn read_thumbnail(&self, engine: &PhilipsEngine, size: &Size) -> Result<RgbImage> {
let level_count = self.num_derived_levels() + 1;
let dimension_level_0 = Size::try_from(&self.dimension_ranges(0)?)?;
let best_level = get_best_level_for_dimensions(&size, &dimension_level_0, level_count);
let best_level = get_best_level_for_dimensions(size, &dimension_level_0, level_count);
let dimensions_range = self.dimension_ranges(best_level)?;
let region_request = RegionRequest {
roi: Rectangle {
Expand All @@ -144,7 +144,7 @@ impl<'a> View<'a> {
level: best_level,
};
let image = self.read_image(engine, &region_request)?;
let final_size = preserve_aspect_ratio(&size, &Size::try_from(&dimensions_range)?);
let final_size = preserve_aspect_ratio(size, &Size::try_from(&dimensions_range)?);
let image = resize_rgb_image(image, &final_size)?;
Ok(image)
}
Expand Down