Created
August 9, 2024 05:04
-
-
Save huzecong/8bbfe7d43058714b42804ac8061ab967 to your computer and use it in GitHub Desktop.
Repair HEIF files produced by Sony cameras to show up with the correct orientation in iOS Photos.
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
#!/usr/bin/env bash | |
# Usage: ./fix-sony-heif /path/to/directory/with/photos | |
# Works by fixing EXIF rotation info and renaming .HIF to .HEIC. | |
# Based on discussion here: https://www.reddit.com/r/SonyAlpha/comments/173qnzg/comment/kr4dcoc/ | |
if [ $# == 1 ]; then | |
cd $1 | |
fi | |
exiftool '-Orientation<CameraOrientation' -ext hif * -r | |
rm *.HIF_original | |
for x in $(ls *.HIF); do | |
mv -- "$x" "${x%.HIF}.HEIC" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment