Compare commits
No commits in common. "9e949cde564109ca26880e8d3a5f6ab839a4922c" and "33d836ae4736458db89a4f9644182cfbcfa56822" have entirely different histories.
9e949cde56
...
33d836ae47
@ -1,21 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Check if both directory and quality are provided
|
|
||||||
if [ -z "$1" ] || [ -z "$2" ]; then
|
|
||||||
echo "Usage: $0 <directory> <quality>"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set the directory and quality from arguments
|
|
||||||
directory="$1"
|
|
||||||
quality="$2"
|
|
||||||
|
|
||||||
# Loop through each image in the directory and reduce quality
|
|
||||||
for file in "$directory"/*.{jpg,jpeg,png}; do
|
|
||||||
if [ -f "$file" ]; then
|
|
||||||
convert "$file" -quality "$quality" "$file"
|
|
||||||
echo "Compressed $file to $quality% quality."
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Compression completed for all images in $directory with $quality% quality."
|
|
Loading…
Reference in New Issue
Block a user