Skip to content

Commit

Permalink
Fixed pathing bug in the ConvertFlirJPG function that was preventing …
Browse files Browse the repository at this point in the history
…it from working. v 2.2
  • Loading branch information
gtatters committed Feb 21, 2020
1 parent 81e4f2d commit f1c7be2
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions toolsets/ThermImageJ.ijm
Original file line number Diff line number Diff line change
Expand Up @@ -961,15 +961,26 @@ function ConvertFLIRJPGs() {
dirpath=File.getParent(filelist[0]);
}

convertfolder=dirpath + "converted";
convertfolder = dirpath + File.separator + "converted";
File.makeDirectory(convertfolder);


print(dirpath);

for (i = 0; i < filelist.length; i++){

showProgress(i/filelist.length);

// because filelist is different for my folder option vs. the single file option, need to set
// filepath formally here

filepath=dirpath + filelist[i];

if(whichtype=="Folder"){
filepath=dirpath + filelist[i];
}

if(whichtype=="File"){
filepath=filelist[i];
}

if (endsWith(toLowerCase(filepath), ".jpg")) {

filename=File.getName(filepath);
Expand All @@ -983,7 +994,7 @@ function ConvertFLIRJPGs() {
// determine the data storage format of the flir jpg. Either tiff or png
RawThermalType=replace(RawThermalType, "\n", "");
RawThermalType=replace(RawThermalType, " ", "");

if(RawThermalType==" " || RawThermalType==" " || RawThermalType==""){
print("Raw Thermal Type Unknown. Setting it to tiff");
RawThermalType="tiff";
Expand Down

0 comments on commit f1c7be2

Please sign in to comment.