MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ is_image() [1/2]

bool MayaFlux::is_image ( const fs::path &  filepath)

Definition at line 14 of file Depot.cpp.

15{
16 if (!fs::exists(filepath) || !fs::is_regular_file(filepath)) {
17 return false;
18 }
19
20 auto ext = filepath.extension().string();
21 std::ranges::transform(ext, ext.begin(),
22 [](unsigned char c) { return std::tolower(c); });
23
24 static const std::unordered_set<std::string> image_extensions = {
25 ".png", ".jpg", ".jpeg", ".bmp", ".tga",
26 ".psd", ".gif", ".hdr", ".pic", ".pnm"
27 };
28
29 return image_extensions.contains(ext);
30}