Enable saving HEIF/HEIC when supported by 3rd party plug-ins (#3110)

This commit is contained in:
Daniel Novomeský
2023-06-20 22:40:56 +02:00
committed by GitHub
parent 6544389bd9
commit 1df8748a10

View File

@@ -67,9 +67,11 @@ QString ShowSaveFileDialog(const QString& title, const QString& directory)
// Build string list of supported image formats // Build string list of supported image formats
QStringList mimeTypeList; QStringList mimeTypeList;
foreach (auto mimeType, QImageWriter::supportedMimeTypes()) { foreach (auto mimeType, QImageWriter::supportedMimeTypes()) {
// HEIF is meant for videos and it causes a glitch on MacOS // image/heif has several aliases and they cause glitch in save dialog
// because the native dialog lumps together heic and heif // It is necessary to keep the image/heif (otherwise HEIF plug-in from
if (mimeType != "image/heif") { // kimageformats will not work) but the aliases could be filtered out.
if (mimeType != "image/heic" && mimeType != "image/heic-sequence" &&
mimeType != "image/heif-sequence") {
mimeTypeList.append(mimeType); mimeTypeList.append(mimeType);
} }
} }