Record Table Error

128 views
Skip to first unread message

clara.mon...@hotmail.co.uk

unread,
Sep 25, 2018, 1:52:01 AM9/25/18
to camtrapR
Hello, 

I am getting the following error come up when trying to run this piece of code to generate a record table. I had this working on my desktop computer but am now trying to do the same thing on my laptop, with no success. Thus I am wondering if the problem is due to something within the actual files, or perhaps the version of the exif tool I'm trying to use on this machine (I had no problem running the imageRename function from this machine however)? If anyone can help it would be greatly appreciated! 

recordTable(inDir = "E:/KWCI_Camera_Trap_Data_Clara/2017_2018_Field_Season/Sorted_data3", 
            IDfrom = "directory", cameraID = 'directory', camerasIndependent = FALSE, minDeltaTime = 0, 
            timeZone = "Asia/Riyadh", writecsv = TRUE, 
            outDir = "E:/KWCI_Camera_Trap_Data_Clara/2017_2018_Field_Season/Record_table", removeDuplicateRecords = FALSE)

Error in system(command.tmp, intern = TRUE) : 
  'CreateProcess' failed to run 'E:\KWCI_C~1\2017_2~1\exiftool.exe -q -f -t -r -Directory -FileName -EXIF:DateTimeOriginal -HierarchicalSubject -ext JPG "E:/KWCI_Camera_Trap_Data_Clara/2017_2018_Field_Season/Sorted_data3/1718_Dawna_gridA83_C29"'

Another question is, I have another set of camera trap data where the photos have not only been sorted into species folders but also number of individuals in each photo within species folders. Should I still be able to run this the same way to generate a species record table? The last time I tried to do this I ended up with lists of number in the species column, but it would be quite a lengthy task to extract all images from the numbers folders. 

Thank you for any help coming my way! 

Clara 

Juergen Niedballa

unread,
Oct 3, 2018, 10:55:25 AM10/3/18
to camtrapR
Hi Clara,
I have never seen this issue before. The problem arises when calling exiftool from within R (Error in system(command.tmp, intern = TRUE)).
Windows seems to be unable to start exiftool ( 'CreateProcess' failed to run 'E:\KWCI_C~1\2017_2~1\
exiftool.exe).
Is exiftool in the directory you specified (E:\KWCI_C~1\2017_2~1\)?
Can you move the exiftool.exe file to another location , e.g. C:/Windows?

About the other question. Did you try running recordTable on those data? I am not sure at the moment whether it will work, but just give it a try and let us know please.

Best,
Jürgen

clara.mon...@hotmail.co.uk

unread,
Nov 5, 2018, 1:04:44 AM11/5/18
to camtrapR
Hi Jurgen, 

I have the exiftool.exe in the specified directory, yes. I have now put copies of it in multiple other locations also, and tried running a sample set of data directly from the laptop, but now am simply getting the error: cannot find ExifTool. I have uninstalled and re installed updated versions of R and camtrapR, uninstalled and reinstalled the exiftool itself, but nothing seems to work. 

Have come to a standstill :( 

Clara

Juergen Niedballa

unread,
Nov 10, 2018, 1:57:28 AM11/10/18
to camtrapR
Hi Clara,
assuming you use Windows, can you please open the terminal (cmd.exe), type

exiftool

and let us know the output? That way we can see whether windows can find exiftool.

Also, you can run  Sys.getenv("PATH") to  see which directories are in Windows PATH. exiftool must be in one of those. Genreally I'd recommend to put exiftool.exe in C:/Windows.

If you can't put it in any of the PATH directories, please have a look at the function exiftoolPath().

Best regards,
Jürgen

Olga

unread,
Feb 21, 2025, 9:56:28 PMFeb 21
to camtrapR
Hello,
I am writing 7 years after this consultation because I am getting exactly the same error.
I have reinstalled exiftool several times, it is in the C:/Windows directory as instructed, but whenever I try to input the following code, it gives me back the same error:

> exifTagNames(inDir = tag_images)
Metadata of: D:/cam_trap_m25oct21/TAGGED/C15/IMG_0001.JPG Error in system(command.tmp1, intern = TRUE): 'CreateProcess' failed to run C:\Windows\exiftool.exe -s1 -t -G0 "D:/cam_trap_m25oct21/TAGGED/C15/IMG_0001.JPG"

I tried to type in the terminal "exiftool", and the output was that it is not recognized as any command or program. I typed Sys.geteny("PATH") in RStudio, and in the text that was displayed I could not read "exiftool" anywhere. I tried using the exiftoolPath(exiftoolDir = exiftool_dir) command, but it failed, as if RStudio did not recognize the input.

Could you help me? Thank you so much in advance,
Olga

Jürgen Niedballa

unread,
Feb 22, 2025, 1:21:05 AMFeb 22
to Olga, camtrapR
Hello,
your system can't find exiftool. 

To add the directory containing Exiftool to the PATH temporarily (in your R session), instead of
exiftoolPath(exiftoolDir = exiftool_dir)
please try:
addToPath(directory = exiftool_dir)

The function was renamed because I found it useful in many other contexts besides exiftool.

If that doesn't solve the problem please share the code you used and the R output.
Thank you and best regards,

--
You received this message because you are subscribed to the Google Groups "camtrapR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camtrapr+u...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/camtrapr/332765cc-863b-4394-9197-9218aeb7ba31n%40googlegroups.com.

Olga

unread,
Mar 30, 2025, 3:50:11 PMMar 30
to camtrapR
Hello! Thank you so much for your answer. I do not know if I used it correctly, but it did not fix the problem... This is the code:

rm(list = ls()) 

Sys.which("exiftool") != ""

->The answer in the console was TRUE

Sys.which("exiftool")
  
-> Exiftool is inside the windows folder: " "C:\\Windows\\exiftool.exe"   "

    exiftool_dir <- "C:/Windows/exiftool.exe" 

setwd("C:/Users/olgam/Desktop/TAGGED")

tag_images <- file.path("C:/Users/olgam/Desktop/TAGGED")

tag_images

exiftool_dir<-"C:/Windows/Exiftool"      

exiftoolPath(exiftoolDir = exiftool_dir)

-> This is where the first error takes place, as the console says "exiftoolPath" function can not be found, so I tried the new code:

addToPath(directory = exiftool_dir)

-> the console says nothing
 
Sys.which("exiftool")

??exiftoolPath

exifTagNames(inDir = tag_images)

-> This is where the ultimate error occurs, where the console says:  Error in system(command.tmp1, intern = TRUE).  'CreateProcess' failed to run C:\Windows\exiftool.exe -s1 -t -G0 "NA"

And here it is where I am trapped...

Thank you so much for your help in advance, sorry for replying so late.

Juergen Niedballa

unread,
Apr 2, 2025, 12:29:29 PMApr 2
to camtrapR
Hello,

It looks like there's confusion between the path to the exiftool executable and the directory containing it, which is causing ExifTool to not function properly in camtrapR.

Here's how to fix it:

  1. First, I notice you have the correct path to the executable: "C:\\Windows\\exiftool.exe", but when you set exiftool_dir, you're using "C:/Windows/Exiftool" which is not the same.
  2. When using addToPath(), you need to provide the directory containing exiftool.exe, not the path to the executable itself.

Try this revised code:

# Clear environment
rm(list = ls())

# Check if exiftool is already in your system PATH
Sys.which("exiftool")
# This should return "C:\\Windows\\exiftool.exe" if it's in your PATH

# Set the directory containing exiftool.exe (not the executable itself)
exiftool_dir <- "C:/Windows"  # This is the directory containing exiftool.exe
# it should not be necessary to add C:/Windows, since that's in PATH already, but anyways
addToPath(directory = exiftool_dir)

# Verify exiftool is now in PATH
Sys.which("exiftool")

# define image path

tag_images <- file.path("C:/Users/olgam/Desktop/TAGGED")

# Now try exifTagNames
exifTagNames(inDir = tag_images)
Reply all
Reply to author
Forward
0 new messages