1

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.

  • 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). – Philip Kendall May 19 '17 at 18:38
  • Can you provide an example of how you're using exiftool? Can you post the output of exiftool? – scottbb May 19 '17 at 18:43
  • Suggest me a place where I can upload the photo without losing the EXIF data. I would be happy to do that. – Inspired_Blue May 19 '17 at 18:55
  • 1
    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. – scottbb May 19 '17 at 21:07
  • 1
    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! =) – scottbb May 19 '17 at 22:47
2

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.

1

(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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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