Created
December 17, 2017 20:40
-
-
Save srosenthal/3adc0dafcdd3c55656bad7a4a8de9c91 to your computer and use it in GitHub Desktop.
Batch convert HEIC (iPhone) photos to JPEG, preserving creation dates
This file contains 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
for i in *.heic; do sips -s format jpeg -s formatOptions best "${i}" --out "${i%heic}jpg" && touch -r "${i}" "${i%heic}jpg"; done |
Or, with imageMagick: for i in *.HEIC; do convert "${i}" "${i%heic}.jpg" && touch -r "${i}" "${i%heic}.jpg"; done
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks.
I had to tweak it a bit to get it to work (it was outputting '.HEICjpg' as file ext. and not finding
.HEIC
files (because iOS outputs uppercase file extensions for photos):for i in *.HEIC; do sips -s format jpeg -s formatOptions best "${i}" --out "${i%heic}.jpg" && touch -r "${i}" "${i%heic}.jpg"; done