summaryrefslogtreecommitdiff
path: root/dcimtimestamp
blob: d67ab208b9036b53af7051e4e7f7ff64aa4041b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

if [ -z "$1" ]; then
	echo "Set file modification time to EXIF timestamp"
	echo "usage: $0 file1.jpg file2.jpg ..."
	exit 0
fi

while [ ! -z "$1" ]; do
	file="$1"

	if [ `basename "${file}" ".jpg"`".jpg" = "${file}" ]; then

		echo "settimg modification time for $file"

                # set file timestamp from exif data
                exiftool "-DateTimeOriginal>FileModifyDate" "${file}"
	fi

	shift
done