Fix filename suggestion of exported image

If the filename had a non-TTI extension it would not have been changed to
PNG or GIF.
This commit is contained in:
Gavin MacGregor
2025-01-12 14:54:08 +00:00
parent cdfcdd8754
commit d5d173bb84

View File

@@ -190,11 +190,8 @@ void MainWindow::exportImage()
else { else {
// Image not exported before: suggest a filename with image extension // Image not exported before: suggest a filename with image extension
// If page has flashing, suggest GIF // If page has flashing, suggest GIF
exportFileName = m_curFile; exportFileName = m_curFile.left(m_curFile.lastIndexOf('.'));
if (m_textWidget->flashTiming() != 0) exportFileName.append(m_textWidget->flashTiming() != 0 ? ".gif" : ".png");
changeSuffixFromTTI(exportFileName, "gif");
else
changeSuffixFromTTI(exportFileName, "png");
} }
if (m_textWidget->flashTiming() != 0) if (m_textWidget->flashTiming() != 0)