gtatters / Thermimage

R Package for working with radiometric thermal image files and data
GNU General Public License v3.0
164 stars 41 forks source link

Thermimage / Error in system2 #4

Closed washfaq closed 5 years ago

washfaq commented 5 years ago

Hello, I am following the link (https://github.com/gtatters/Thermimage) to analyze my Thermal images, but I found an error when I try to read image. The code I am using is :

imagefile<-paste0(system.file("extdata/IR_2412.jpg", package="Thermimage")) cams<-flirsettings(imagefile, exiftool="installed", camvals="")

but I found this error,

Error in system2(syscommand, args = paste0(shQuote(imagefile), " ", camvals), : 'CreateProcess' failed to run 'C:\windows\exiftool.exe "C:/Users/washfaq/Documents/R/win-library/3.6/Thermimage/extdata/IR_2412.jpg"

My session info is below;

R version 3.6.0 (2019-04-26) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

Random number generation: RNG: Mersenne-Twister Normal: Inversion Sample: Rounding

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] exifr_0.3.1 installr_0.21.3 stringr_1.4.0 Thermimage_3.2.1

loaded via a namespace (and not attached): [1] Rcpp_1.0.1 fansi_0.4.0 assertthat_0.2.1 zeallot_0.1.0 utf8_1.1.4 crayon_1.3.4
[7] rappdirs_0.3.1 plyr_1.8.4 backports_1.1.4 jsonlite_1.6 magrittr_1.5 pillar_1.4.1
[13] cli_1.1.0 rlang_0.3.4 stringi_1.4.3 rstudioapi_0.10 vctrs_0.1.0 tools_3.6.0
[19] yaml_2.2.0 compiler_3.6.0 pkgconfig_2.0.2 tibble_2.1.3

Any idea what might be going wrong? Thanks Waseem

gtatters commented 5 years ago

Have you installed exiftool according to your OS and the exiftool website? Have you verified you can run exiftool at the command line?

In windows, I think you simply go to the run menu, type cmd and hit enter. Then type exiftool You should get a full screen of text with help on how exiftool works?

Windows 10 sometimes does not allow exiftool to run.

gtatters commented 5 years ago

it also may relate to R v 3.6. I have not tested or update the package for 3.6. I doubt that would affect much, but pathing issues are generally the cause of bugs for people.

try putting your testfile on your desktop and change imagefile to:

C:/Users/washfaq/Desktop/testfile.jpg

then rerun in R:

cams<-flirsettings(imagefile, exiftool="installed", camvals="")

washfaq commented 5 years ago

you are right as you mentioned in first comment, exiftool is not properly configured in windown10. I have re-configured the exiftool file, now ThermImage starts working. I hope I will calculate Plant canopy temperature and crop water stress index now as per the temperature readings obtained from ThermImage. Thank you for your help.

gtatters commented 5 years ago

excellent. glad this was fixed!