| 481 | // --- Container I/O --- |
| 482 | |
| 483 | static ImageContainer detectContainer(const std::string& path) |
| 484 | { |
| 485 | auto dot = path.find_last_of('.'); |
| 486 | if (dot == std::string::npos) |
| 487 | return ImageContainer::Unknown; |
| 488 | std::string ext = path.substr(dot); |
| 489 | std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower); |
| 490 | const auto* ci = ImageContainerRegistry::FindByExtension(ext.c_str()); |
| 491 | return ci ? ci->container : ImageContainer::Unknown; |
| 492 | } |
| 493 | |
| 494 | bool Image::Save(const std::string& path) const |
| 495 | { |