Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bash script for setting exif photo date according to filename. Created for whatsapp images can be easily adjusted for every filename patterns.
#!/bin/bash
set -e #Exit as soon as any line in the bash script fails
imageCounter=0
for filename in *.jpg
do
imageCounter=$((imageCounter+=1))
#extracting info from file name
year="${filename:4:4}"
month="${filename:8:2}"
day="${filename:10:2}"
#setting exif timestamp into file
exiv2 -M"set Exif.Image.DateTime $year:$month:$day" $filename
#set the file last modified timestamp
touch -t "$year$month$day""1500" $filename
done
echo "successfully set the correct timestamp in $imageCounter images"
@dileep-aapthitech

This comment has been minimized.

Copy link

@dileep-aapthitech dileep-aapthitech commented Mar 16, 2018

Hi federicoB,

  • We need Storing session data in DynamoDB on Magento
    Please help me.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment