Skip to content

Instantly share code, notes, and snippets.

@zamai
Created March 4, 2024 04:28
Show Gist options
  • Save zamai/75fdac5ba4dbfc3b92c815189c80b2f8 to your computer and use it in GitHub Desktop.
Save zamai/75fdac5ba4dbfc3b92c815189c80b2f8 to your computer and use it in GitHub Desktop.
convert photos jpeg to heic, using sips in Automator for quick action
quality_level="90" # Set quality to 90%
for f in "$@"
do
echo "Processing $f"
# Define the output filename by changing the extension to .heic
output_file="${f%.*}.heic"
# Convert JPEG to HEIC with specified quality using sips
sips -s format heic --setProperty formatOptions $quality_level "$f" --out "$output_file"
echo "Conversion and metadata copying complete for $f"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment