Work on file types

This commit is contained in:
Matt McWilliams 2023-02-03 21:50:01 -05:00
parent 840f6743f9
commit 5d5275bf25
1 changed files with 16 additions and 0 deletions

View File

@ -1,14 +1,30 @@
#include <iostream>
#include <opencv2/core.hpp>
#include <sys/stat.h>
#include <filesystem> // 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)
{