change cmakelists and gitignore, commit third librarys source
This commit is contained in:
15
src/UtilTool.cc
Normal file
15
src/UtilTool.cc
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "UtilTool.h"
|
||||
#include <filesystem>
|
||||
|
||||
|
||||
bool UtilTool::CheckFileIsImage(const std::string& filepath){
|
||||
//简单实现, 通过后缀判断
|
||||
auto path = std::filesystem::path(filepath);
|
||||
auto su = path.extension().string();
|
||||
for(const auto& type : ImageType){
|
||||
if (su.find(type) != std::string::npos){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user