기타

구글포토백업파일 exiftool를 이용해서 메타데이터 수정하기(촬영일 수정)

greathuman 2022. 10. 20. 17:10

구글포토 내보내기로 백업파일 받을 경우 pc에서는 사진파일의 생성일 수정일이 백업한 날짜로되어있다.

다른 클라우드로 옮길경우 백업 날짜 기준으로 올라가니 이를 수정해줄 필요가있다.

 

구글포토 백업은 json 파일에 해당 메타데이터들이 저장되는데 exiftool를 이용해서 json 데이터를 사진 데이터에 맵핑시킬 수 있다.

 

 

프로그램 다운로드 : https://exiftool.org/

 

 

윈도우 cmd 창을 열고 exiftool.exe 가 위치한 디렉토리로 이동한다.

해당 위치에서 아래의 명령어를 실행한다.

 

GPS 태그 복사
exiftool -tagsfromfile '%d/%F.json' '-GPSAltitude<GeoDataAltitude' '-GPSLatitude<GeoDataLatitude' '-GPSLatitudeRef<GeoDataLatitude' '-GPSLongitude<GeoDataLongitude' '-GPSLongitudeRef<GeoDataLongitude' 디렉토리나파일명

키워드 복사:
exiftool -tagsfromfile '%d/%F.json' '-Keywords<Tags' '-Subject<Tags' 디렉토리나파일명

설명 복사:
exiftool -tagsfromfile '%d/%F.json' '-Caption-Abstract<Description' '-ImageDescription<Description' -Description 디렉토리나파일명

JSON의 모든 데이터를 파일로 복사하여 원본 파일 수정

exiftool -r -d %s -tagsfromfile "%d/%F.json" "-GPSAltitude<GeoDataAltitude" "-GPSLatitude<GeoDataLatitude" "-GPSLatitudeRef<GeoDataLatitude" "-GPSLongitude<GeoDataLongitude" "-GPSLongitudeRef<GeoDataLongitude" "-Keywords<Tags" "-Subject<Tags" "-Caption-Abstract<Description" "-ImageDescription<Description" "-DateTimeOriginal<PhotoTakenTimeTimestamp" -ext jpg -overwrite_original 디렉토리나파일명

 

위 명령어로 json데이터를 사진파일에 맵핑시켰다면 사진파일의 exif 정보를 토대로 사진파일의 수정일을 실제 촬영일로 변경해준다

 

exiftool "-FileCreateDate<$EXIF:DateTimeOriginal" "-FileModifyDate<$EXIF:DateTimeOriginal" "사진이 있는 폴더" -r

 

동영상의 경우 EXIF 정보가 아니여서 변경이 안될 수 있다 그럴경우

 

exiftool "-FileCreateDate<CreateDate" "-FileModifyDate<ModifyDate" "동영상 있는 폴더" -r