Skip to content

Instantly share code, notes, and snippets.

@Vicfred
Last active October 18, 2023 03:52
Show Gist options
  • Save Vicfred/ebaf345f26f178c4d10925441b1c5ff7 to your computer and use it in GitHub Desktop.
Save Vicfred/ebaf345f26f178c4d10925441b1c5ff7 to your computer and use it in GitHub Desktop.
camera exif data metadata

Add or substract X hours to photo's date

exiftool -alldates+=X -filemodifydate+=X -filecreatedate+=X -overwrite_original *.JPG

Change photo modification date to match exif timestamp

exiv2 -T rename *.jpg

Change .JPG extension to .jpg

for f in *.JPG; do mv -- "$f" "${f%.JPG}.jpg"; done

Set jpg filenames to photo original datetime

exiftool -ext jpg '-FileName<DateTimeOriginal' -d %Y_%m_%d__%H_%M_%S%%-c.%%e .

Set jpg filenames to photo creation file

exiftool -ext jpg '-FileName<CreateDate' -d %Y_%m_%d__%H_%M_%S%%-c.%%e .

View photo metadata

exif DSC00769.jpg

Sometimes the file created date is wrong even if the taken date is right (check with ls -al and exif file.JPG)

exiftool -filemodifydate+=7 -overwrite_original *.JPG

Resize and compress for pixel 8 pro @ 50MP

mogrify -resize 30% -quality 90% *.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment