Skip to content

Commit

Permalink
Merge pull request #33 from nationaldronesau/dev
Browse files Browse the repository at this point in the history
added fix to handle dots in filenames properly
  • Loading branch information
williams9438 authored Jun 27, 2024
2 parents f3c084a + 427739f commit 0b65434
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions flirimageextractor/flir_image_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,11 @@ def save_images(self, minTemp=None, maxTemp=None, bytesIO=False):
) / (np.amax(self.thermal_image_np) - np.amin(self.thermal_image_np))

if not bytesIO:
thermal_output_filename_array = self.flir_img_filename.split(".")
# use splitext to handle dots in filenames properly.
thermal_output_filename_array = os.path.splitext(self.flir_img_filename)
thermal_output_filename = (
thermal_output_filename_array[0]
+ "_thermal."
+ "_thermal"
+ thermal_output_filename_array[1]
)

Expand All @@ -434,12 +435,12 @@ def save_images(self, minTemp=None, maxTemp=None, bytesIO=False):
transformed_filename = transform_filename_into_directory(
thermal_output_filename, str(palette.name)
)
filename_array = transformed_filename.split(".")
# use splitext to handle dots in filenames properly.
filename_array = os.path.splitext(transformed_filename)
filename = (
filename_array[0]
+ "_"
+ str(palette.name)
+ "."
+ filename_array[1]
)
if self.is_debug:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "flirimageextractor"
version = "1.5.5"
version = "1.5.6"
description = "A small tool/lib to read temperatures and original photos from FLIR® thermal camera images."
authors = [
"National Drones <[email protected]>",
Expand Down

0 comments on commit 0b65434

Please sign in to comment.