From bb36368ad26087590d5f09f7a333caed09cf3879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Mon, 9 Sep 2024 17:30:39 +0200 Subject: [PATCH] Revert proof of concept for covers as webp This was pushed to develop by mistake --- YACReaderLibrary/initial_comic_info_extractor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/YACReaderLibrary/initial_comic_info_extractor.cpp b/YACReaderLibrary/initial_comic_info_extractor.cpp index 7cacf466..eb543397 100644 --- a/YACReaderLibrary/initial_comic_info_extractor.cpp +++ b/YACReaderLibrary/initial_comic_info_extractor.cpp @@ -156,15 +156,15 @@ void InitialComicInfoExtractor::saveCover(const QString &path, const QImage &cov { QImage scaled; if (cover.width() > cover.height()) { - scaled = cover.scaledToWidth(820, Qt::SmoothTransformation); + scaled = cover.scaledToWidth(640, Qt::SmoothTransformation); } else { auto aspectRatio = static_cast(cover.width()) / static_cast(cover.height()); auto maxAllowedAspectRatio = 0.5; if (aspectRatio < maxAllowedAspectRatio) { // cover is too tall, e.g. webtoon - scaled = cover.scaledToHeight(1220, Qt::SmoothTransformation); + scaled = cover.scaledToHeight(960, Qt::SmoothTransformation); } else { - scaled = cover.scaledToWidth(640, Qt::SmoothTransformation); + scaled = cover.scaledToWidth(480, Qt::SmoothTransformation); } } - scaled.save(_target, "WEBP", 75); + scaled.save(_target, 0, 75); }