From 5d5275bf25b954d4114e52631a392d66344fba88 Mon Sep 17 00:00:00 2001 From: mattmcw Date: Fri, 3 Feb 2023 21:50:01 -0500 Subject: [PATCH] Work on file types --- example.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/example.cpp b/example.cpp index fadd57c..d5325f5 100644 --- a/example.cpp +++ b/example.cpp @@ -1,14 +1,30 @@ #include #include #include +#include // C++17 + +namespace fs = std::filesystem; using namespace std; using namespace cv; +string supportedExt[10] = { + ".jpg", ".JPG", + ".jpeg", ".JPEG", + ".png", ".PNG", + ".tif", ".TIF", + ".tiff", ".tiff" +}; + inline bool file_exists (const std::string& name) { struct stat buffer; return (stat (name.c_str(), &buffer) == 0); } + +inline bool is_image (const std::string& name) { + fs::path filePath = name; + if (filePath.extension() == ".jpg") +} int main(int argc, char** argv) {