Add support for loading custom comic images

This commit is contained in:
Luis Ángel San Martín
2025-05-09 19:25:02 +02:00
parent 0457c08fca
commit 508ff6d547
9 changed files with 99 additions and 27 deletions

View File

@ -1,6 +1,7 @@
#include "library_window.h"
#include "yacreader_global.h"
#include "yacreader_global_gui.h"
#include <QHBoxLayout>
#include <QSplitter>
@ -2313,12 +2314,7 @@ void LibraryWindow::setFolderCover()
void LibraryWindow::setCustomFolderCover(Folder folder)
{
QString supportedImageFormatsString;
for (const QByteArray &format : QImageReader::supportedImageFormats()) {
supportedImageFormatsString += QString("*.%1 ").arg(QString(format));
}
QString customCoverPath = QFileDialog::getOpenFileName(this, tr("Select custom cover"), QDir::homePath(), tr("Images (%1)").arg(supportedImageFormatsString));
auto customCoverPath = YACReader::imageFileLoader(this);
if (!customCoverPath.isEmpty()) {
QImage cover(customCoverPath);
if (cover.isNull()) {