mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-06-03 17:08:08 -04:00
[imagedump] Add "list MIME type" (-m) option
Allows listing the supported mime types
This commit is contained in:
parent
134c96fa61
commit
a4b8295625
@ -45,6 +45,10 @@ int main(int argc, char **argv)
|
||||
QStringList() << QStringLiteral("l") << QStringLiteral("list-file-formats"),
|
||||
QStringLiteral("List supported image file formats"));
|
||||
parser.addOption(listformats);
|
||||
QCommandLineOption listmimetypes(
|
||||
QStringList() << QStringLiteral("m") << QStringLiteral("list-mime-types"),
|
||||
QStringLiteral("List supported image mime types"));
|
||||
parser.addOption(listmimetypes);
|
||||
QCommandLineOption listqformats(
|
||||
QStringList() << QStringLiteral("p") << QStringLiteral("list-qimage-formats"),
|
||||
QStringLiteral("List supported QImage data formats"));
|
||||
@ -63,6 +67,15 @@ int main(int argc, char **argv)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (parser.isSet(listmimetypes)) {
|
||||
QTextStream out(stdout);
|
||||
out << "MIME types:\n";
|
||||
const auto lstSupportedMimeTypes = QImageReader::supportedMimeTypes();
|
||||
for (const auto &fmt : lstSupportedMimeTypes) {
|
||||
out << " " << fmt << '\n';
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if (parser.isSet(listqformats)) {
|
||||
QTextStream out(stdout);
|
||||
out << "QImage formats:\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user