1
\$\begingroup\$

I am using a wearable bluetooth wifi camera. How do I find the time when a particular picture was taken?

So far I have tried to look at the metadata on the jpg using Exiftool. I am only able to see when the pictures were moved from the micro-SD card to my computer through this.

I know the data of time when the picture was taken is available. Because the camera comes with an android app, and I am able to see the time when picture was taken through the app.

But once I move the picture from the microSD card to my computer, I don't know where to find it again.

Where could this time be hiding?

EDIT:

(The following solution is for a Linux Machine. However for other OS, one can something similar in spirit: SAVE your metadata before moving the images anywhere from the MicroSD)

Using this command before moving the images from MicroSD card: exiftool /path/to/file/filename.JPG | grep Modification

gives the output:

 File Modification Date/Time     : 2017:05:20 01:47:38+05:30

But the actual time of creation in this case was 2017:05:19 20:17:38 which one gets by subtracting the +5:30 for my timezone.

If one moves the file to computer the above data gets permanently over-written. So I have a bash script with which I rename the file with the time of it's creation before moving it anywhere.

Here is the script:

#!/bin/bash

cd "/path/to/file"

for file in *
do 
    out="$(exiftool $file | grep Modification)"
    out=${out:34:19}
    out=${out/":"/"-"}
    out=${out/":"/"-"}
    out=$(date -d "$out")
    out=$(date -d "$out -330 minutes" +'%Y-%m-%d-%H%M%S')
       # Replace -330 with offset needed for your timezone
    if [[ $file == *.jpg ]]
    then
        mv "$file" "${out}.JPG"
    fi
    if [[ $file == *.MP4 ]]
    then
        mv "$file" "${out}.MP4"
    fi
done

I am happy with this for now.

\$\endgroup\$
9
  • \$\begingroup\$ Could you upload one of the photos somewhere other than Stack Exchange so someone can dig through the EXIF data? (Imgur, which Stack Exchanges uses for image hosting, unfortunately removes EXIF data). \$\endgroup\$
    – Philip Kendall
    May 19, 2017 at 18:38
  • \$\begingroup\$ Can you provide an example of how you're using exiftool? Can you post the output of exiftool? \$\endgroup\$
    – scottbb
    May 19, 2017 at 18:43
  • \$\begingroup\$ Suggest me a place where I can upload the photo without losing the EXIF data. I would be happy to do that. \$\endgroup\$ May 19, 2017 at 18:55
  • 1
    \$\begingroup\$ The Android app (or possibly the camera) might be retaining some information about those files. You can test this by checking the image date of fileA.jpg and fileB.jpg (just pick two files on your card, fileA and fileB are placeholders) in the app, then remove the MicroSD card. On your computer, swap the file names of the two files, and put the MicroSD card back. If the Android app shows the same file date for fileA both before and after filename swapping, then the data is not coming from within the file; it's being stored externally to the file. \$\endgroup\$
    – scottbb
    May 19, 2017 at 21:07
  • 1
    \$\begingroup\$ Glad to hear your issue is resolved! Please write up your findings as an answer to your question (basically, your last comment), and then mark your answer as the accepted answer. You get the points, and Photo.SE gets another closed question! =) \$\endgroup\$
    – scottbb
    May 19, 2017 at 22:47

2 Answers 2

2
\$\begingroup\$

I'd suggest saving the timestamp directly into the file metadata. You can do this and rename an entire directory with a single exiftool command.

Try this:
exiftool -globalTimeShift -5:30 -d '%Y-%m-%d-%H%M%S.%%e' '-ModifyDate<FileModifyDate#' '-CreateDate<FileModifyDate#' '-DateTimeOriginal<FileModifyDate#' '-Filename<FileModifyDate' /path/to/Target/Dir

Breakdown:
-globalTimeShift -5:30: Shifts all date/time tags. In this case, subtracts the 5 hours, 30 minutes you need to shift by.
-d '%Y-%m-%d-%H%M%S.%%e': Reformats all date tags into the format you want to use to rename your file.
'-ModifyDate<FileModifyDate#'…: Copies the FileModifyDate into the three tags listed (DateTimeOriginal, CreateDate, and ModifyDate), shifted as mentioned above. The hashtag tells exiftool to use the tag unmodified by the -d option. Exiftool would have worked fine without it in this case, but if the -d option were different, e.g. you were using US date format, it might be affected and save an incorrect timestamp.
'-Filename<FileModifyDate': Renames the file to your desired format.

You will find this to be much faster than a script, especially in the case of a large amount of files, as exiftool has to startup only once rather than once for every file.

Additional:
Add -r if you want to recurse into subdirectories. Add -overwrite_original to avoid making backup _original files.

\$\endgroup\$
1
\$\begingroup\$

(The following solution is for a Linux Machine. However for other OS, one can something similar in spirit: SAVE your metadata before moving the images anywhere from the MicroSD)

Using this command before moving the images from MicroSD card: exiftool /path/to/file/filename.JPG | grep Modification

gives the output:

File Modification Date/Time : 2017:05:20 01:47:38+05:30

But the actual time of creation in this case was 2017:05:19 20:17:38 which one gets by subtracting the +5:30 for my timezone.

If one moves the file to computer the above data gets permanently over-written. So I have a bash script with which I rename the file with the time of it's creation before moving it anywhere.

Here is the script:

#!/bin/bash

cd "/path/to/file"

for file in *
do 
    out="$(exiftool $file | grep Modification)"
    out=${out:34:19}
    out=${out/":"/"-"}
    out=${out/":"/"-"}
    out=$(date -d "$out")
    out=$(date -d "$out -330 minutes" +'%Y-%m-%d-%H%M%S')
       # Replace -330 with offset needed for your timezone
    if [[ $file == *.jpg ]]
    then
        mv "$file" "${out}.JPG"
    fi
    if [[ $file == *.MP4 ]]
    then
        mv "$file" "${out}.MP4"
    fi
done

I am happy with this for now.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.