Skip to content

Commit

Permalink
refactor: make extension lowercase when loading image
Browse files Browse the repository at this point in the history
  • Loading branch information
r3tr0ananas committed Jan 13, 2025
1 parent 930c438 commit 11602a4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/image.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::path::PathBuf;

use imagesize::ImageSize;

use crate::{upscale::UpscaleOptions, Error};
Expand All @@ -14,7 +13,7 @@ impl Image {
pub fn from_path(path: PathBuf) -> Result<Self, Error> {
if let Some(extension) = path.extension() {
let allowed_extensions = vec!["png", "jpeg", "jpg", "webp"];
let extension_string = extension.to_string_lossy().to_string();
let extension_string = extension.to_string_lossy().to_string().to_lowercase();

match allowed_extensions.iter().any(|e| extension_string.contains(e)) {
true => {
Expand Down

0 comments on commit 11602a4

Please sign in to comment.