Error in function recordTable in camptrapR

Started by Tamarabdg, October 28, 2021, 09:12:49 AM

Previous topic - Next topic

Tamarabdg

Hello everyone,

This is my first post in this forum. I am starting to use the package camtrapR for extracting metadata from jpg images from camera traps.

When I try to get the metadata table with the function recordTable, I get the following error message:

"Error in (function (intable, deltaTimeComparedTo, columnOfInterest, cameraCol,  :
  Could not read any Exif DateTimeOriginal tag at station: CAM1 Consider checking for corrupted Exif metadata"

I have checked for metadata tag names with this code:

> exifTagNames(inDir = prueba,
+              whichSubDir = "CAM1",
+              #fileName,
+              returnMetadata = "DEPRECATED",
+              returnTagGroup = "DEPRECATED")


And I got that I actually have DateTimeOriginal tag in my metadata.


Metadata of:
prueba2/CAM1/Genetta_genetta/IMAG0027.JPG
    tag_group                tag_name
1    ExifTool         ExifToolVersion
[...]
34       EXIF        DateTimeOriginal
35       EXIF              CreateDate


So, what it is happening? I only have copied-pasted the images from SD cards to my hard disc, I have not modifed nothing. The metadata information about date and time is correct in the files, so why ExifTool can't read it?

I also have tried with other images from a coleague with the same code and the output was ok.

Thank you very much for your help.

Tamara

StarGeek

Have you tried running exiftool directly on one of the files and looked at the output?  Because nothing you posted is exiftool output.  Can you share an example file?

First, run this command on a file and post the output
exiftool -G1 -a -s -warning -validate file.jpg

Then do the same with this command
exiftool -time:all -G1 -a -s file.jpg

An example image that shows the error would still be best though.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Tamarabdg

I don't have tried to run exiftool because I am not very familiar with this commands and I prefer to use it in R.

I attach one example image file just in case you can check it the output in exiftool.

Thanks a lot!

Tamara

Phil Harvey

Hi Tamara,

The EXIF date/time tags are empty in this file:

> exiftool -time:all -G1 IMAG2111.JPG
[IFD0]          Modify Date                     :     :  :     :  :
[ExifIFD]       Date/Time Original              :     :  :     :  :
[ExifIFD]       Create Date                     :     :  :     :  :


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

So you get a "Could not read any Exif DateTimeOriginal tag" error because the files don't have the DateTimeOriginal set.

I do find it interesting that the time tags are set to blank spaces.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Tamarabdg

Thanks for answering so soon.

I find very strange that the Date/Time tags are empty. If I open the properties panel from the image in Windows I get a Modify Date and Create Date (see attached image).

Maybe is something related with the camera model? I am using Boly Guard trail cams (similar to Scout Guard brand).

Thanks!
Tamara

StarGeek

Those aren't embedded metadata like EXIF data.  Those are the file system time stamps and will appear on every single file on the computer.  Exiftool will list those as FileCreateDate and FileModifyDate.

If you wish to copy one of those into the file, you can use a command like this
exiftool "-AllDates<FileModifyDate" /path/to/files/

This command creates backup files.  Add -Overwrite_Original to suppress the creation of backup files.  Add -r to recurse into subdirectories.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).