Skip to content

Commit

Permalink
Add heic-to-jpeg script
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Jan 30, 2024
1 parent dca3d5a commit dc17da3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bin/heic-to-jpeg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -eu -x -o pipefail

# https://apple.stackexchange.com/a/410920

# formatOptions: low, normal, high or best

find . -type f -iname '*.heic' | while read -r i; do \
fileNoExt="${i%.*}"; \
jpgFile="${fileNoExt}_heic_conv.jpg"; \
sips -s format jpeg -s formatOptions high "$i" --out "$jpgFile"; \
touch -r "$i" "$jpgFile"; \
rm "$i"; \
done

0 comments on commit dc17da3

Please sign in to comment.