From 39abd169811c3c0c7dd297cd6439c4792979c7a9 Mon Sep 17 00:00:00 2001 From: Glenn Tattersall Date: Thu, 20 Aug 2020 08:32:14 -0400 Subject: [PATCH] added error warning when trying to load a non-radiometric image file with readflirjpg. See issues [#7](https://github.com/gtatters/Thermimage/issues/7), [#10](https://github.com/gtatters/Thermimage/issues/10), [#13](https://github.com/gtatters/Thermimage/issues/13). --- .gitignore | 2 ++ R/readflirJPG.R | 6 ++++++ README.Rmd | 7 +++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8d0185f..58d73c7 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ README_old.Rmd SampleFLIRCSQ.csq /output .git* +tempfile +.gitignore diff --git a/R/readflirJPG.R b/R/readflirJPG.R index f11e8d7..38536d3 100644 --- a/R/readflirJPG.R +++ b/R/readflirJPG.R @@ -51,10 +51,16 @@ readflirJPG<-function(imagefile, exiftoolpath="installed", headerindex=1) cams <- flirsettings(imagefile, exiftoolpath, camvals = "") + if(is.null(cams$Info$RawThermalImageType)){ + warning("Exiftool cannot extract raw thermal image data.\n Image does not contain FLIR radiometric data.\n Check with the user manual or manufacturer\n or ensure camera is set to save radiometric information.") + } + currentpath <- getwd() to.read <- file("tempfile", "rb") alldata <- readBin(to.read, raw(), n = file.info("tempfile")$size) close(to.read) + + if (cams$Info$RawThermalImageType == "TIFF") { TIFF <- Thermimage::locate.fid(c("54", "49", "46", "46","49", "49"), alldata, zeroindex = FALSE) diff --git a/README.Rmd b/README.Rmd index b0fe743..db600e7 100644 --- a/README.Rmd +++ b/README.Rmd @@ -23,8 +23,8 @@ The version here on github is the current, development version. Archived source # Current release notes -2019-12-20: Version 4.1.0 is on Github (development version) - - added the option to split thermal video files based on different filetype/header types. See issue [#9](https://github.com/gtatters/Thermimage/issues/9). +2020-08-20: Version 4.1.1 is on Github (development version) + - added error warning when trying to load a non-radiometric image file with readflirjpg. See issues [#7](https://github.com/gtatters/Thermimage/issues/7), [#10](https://github.com/gtatters/Thermimage/issues/10), [#13](https://github.com/gtatters/Thermimage/issues/13). @@ -853,6 +853,9 @@ EEVBlog: # Previous release notes +- 2019-12-20: Version 4.1.0 + - added the option to split thermal video files based on different filetype/header types. See issue [#9](https://github.com/gtatters/Thermimage/issues/9). + - 2019-11-26: Version 4.0.1 - fixed problems with system2 piping calls to ffmpeg on windows machines. See issue [#8](https://github.com/gtatters/Thermimage/issues/8). Added common perl script to package to facilitate splitting fff, tiff, jpegls filetypes. Minor changes to __convertflirVID()__ and __ffmpegcall()__ functions.