Skip to content

Commit

Permalink
Add WebP Support
Browse files Browse the repository at this point in the history
  • Loading branch information
ranajahanzaib committed Jan 4, 2025
1 parent 20a9150 commit 0af74e0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 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,6 +1,6 @@
[package]
name = "rico"
version = "0.1.0"
version = "0.1.1"
edition = "2021"

[dependencies]
Expand Down
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ fn convert_image(input_path: &Path, output_dir: &Path, target_format: &str) -> R
"png" => ImageFormat::Png,
"jpg" | "jpeg" => ImageFormat::Jpeg,
"bmp" => ImageFormat::Bmp,
"webp" => ImageFormat::WebP,
_ => return Err(format!("Unsupported format: {}", target_format).into()), // Error for unsupported target formats
};

Expand Down Expand Up @@ -143,7 +144,7 @@ fn main() {
.long("format")
.value_parser(value_parser!(String))
.default_value("png")
.help("Target format for conversion (e.g., png, jpg, bmp)"), // The target format (default is PNG)
.help("Target format for conversion (e.g., png, jpg, bmp, webp)"), // The target format (default is PNG)
)
.get_matches();

Expand Down

0 comments on commit 0af74e0

Please # to comment.