From 627bb2d94ab406b19b27e64203a20d3494d2f770 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Fri, 5 Jan 2024 11:00:02 -0800 Subject: [PATCH] Use modern Boost function to get file extension --- modules/em2d/include/JPGImageReaderWriter.h | 4 ++-- modules/em2d/include/TIFFImageReaderWriter.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/em2d/include/JPGImageReaderWriter.h b/modules/em2d/include/JPGImageReaderWriter.h index 8ffc60f7d0..8366aa6c4f 100644 --- a/modules/em2d/include/JPGImageReaderWriter.h +++ b/modules/em2d/include/JPGImageReaderWriter.h @@ -10,7 +10,7 @@ #include #include "IMP/em2d/opencv_interface.h" #include "IMP/em/ImageHeader.h" -#include +#include IMPEM2D_BEGIN_NAMESPACE @@ -74,7 +74,7 @@ class JPGImageReaderWriter : public ImageReaderWriter { "discards image header " << std::endl); // check extension - String ext = boost::filesystem::extension(filename); + String ext = boost::filesystem::path(filename).extension().string(); IMP_LOG_VERBOSE("JPGImageReaderWriter writing to " << filename << std::endl); if (ext != ".jpg" && ext != ".jpeg") { diff --git a/modules/em2d/include/TIFFImageReaderWriter.h b/modules/em2d/include/TIFFImageReaderWriter.h index 05ffc9a778..46e79f8496 100644 --- a/modules/em2d/include/TIFFImageReaderWriter.h +++ b/modules/em2d/include/TIFFImageReaderWriter.h @@ -76,7 +76,7 @@ class TIFFImageReaderWriter : public ImageReaderWriter { "discards image header " << std::endl); // check extension - String ext = boost::filesystem::extension(filename); + String ext = boost::filesystem::path(filename).extension().string(); IMP_LOG_VERBOSE("TIFFImageReaderWriter writing to " << filename << std::endl); if (ext != ".tiff" && ext != ".tif") {