Skip to content

Instantly share code, notes, and snippets.

@araujo88
Created February 27, 2024 06:53
Show Gist options
  • Save araujo88/660543aff33b04eceee8ab4870294a7f to your computer and use it in GitHub Desktop.
Save araujo88/660543aff33b04eceee8ab4870294a7f to your computer and use it in GitHub Desktop.
convert_webp_to_jpg.sh
#!/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