Update src/main.rs

Co-authored-by: andrews05 <andrew@digerati.co.nz>
This commit is contained in:
LuckyTurtleDev 2023-09-23 09:40:42 +02:00 committed by GitHub
parent 651a7e3b88
commit 370f3d58c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -386,9 +386,8 @@ fn collect_files(
let in_file = if using_stdin {
InFile::StdIn
} else {
//skip non png files if recusive flag is used.
//(still allow the user to convert a non png file if recusive flag is not used);
if !top_level && recursive && {
// Skip non png files if not given on top level
if !top_level && {
let extension = input.extension().map(|f| f.to_ascii_lowercase());
extension != Some(OsString::from("png"))
&& extension != Some(OsString::from("apng"))