32 #include <QImageWriter> 40 if (filename.count (
'.') < 1)
43 const auto& ext = filename.section (
'.', -1, -1);
44 const auto& formats = QImageWriter::supportedImageFormats ();
45 return std::any_of (formats.begin (), formats.end (),
46 [&ext] (
const QByteArray& format)
47 {
return !QString::compare (ext, format, Qt::CaseInsensitive); });
bool HasSupportedImageExtension(const QString &filename)
Checks if the given filename has a known image extension.