Skip to content

Instantly share code, notes, and snippets.

@srosenthal
Created December 17, 2017 20:40
Show Gist options
  • Save srosenthal/3adc0dafcdd3c55656bad7a4a8de9c91 to your computer and use it in GitHub Desktop.
Save srosenthal/3adc0dafcdd3c55656bad7a4a8de9c91 to your computer and use it in GitHub Desktop.
Batch convert HEIC (iPhone) photos to JPEG, preserving creation dates
for i in *.heic; do sips -s format jpeg -s formatOptions best "${i}" --out "${i%heic}jpg" && touch -r "${i}" "${i%heic}jpg"; done
@tlh24
Copy link

tlh24 commented Dec 30, 2020

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