Created
February 27, 2024 06:53
-
-
Save leo-aa88/660543aff33b04eceee8ab4870294a7f to your computer and use it in GitHub Desktop.
convert_webp_to_jpg.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if an argument was provided | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 <image.webp>" | |
exit 1 | |
fi | |
# Input .webp image | |
input_image="$1" | |
# Output .jpg image | |
output_image="${input_image%.webp}.jpg" | |
# Convert the image from .webp to .jpg | |
convert "$input_image" "$output_image" | |
echo "Conversion completed: $output_image" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment