Work on file types
This commit is contained in:
parent
840f6743f9
commit
5d5275bf25
16
example.cpp
16
example.cpp
|
@ -1,15 +1,31 @@
|
|||
#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)
|
||||
{
|
||||
string input;
|
||||
|
|
Loading…
Reference in New Issue