mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Revert proof of concept for covers as webp
This was pushed to develop by mistake
This commit is contained in:
parent
176fdc028a
commit
bb36368ad2
@ -156,15 +156,15 @@ void InitialComicInfoExtractor::saveCover(const QString &path, const QImage &cov
|
|||||||
{
|
{
|
||||||
QImage scaled;
|
QImage scaled;
|
||||||
if (cover.width() > cover.height()) {
|
if (cover.width() > cover.height()) {
|
||||||
scaled = cover.scaledToWidth(820, Qt::SmoothTransformation);
|
scaled = cover.scaledToWidth(640, Qt::SmoothTransformation);
|
||||||
} else {
|
} else {
|
||||||
auto aspectRatio = static_cast<double>(cover.width()) / static_cast<double>(cover.height());
|
auto aspectRatio = static_cast<double>(cover.width()) / static_cast<double>(cover.height());
|
||||||
auto maxAllowedAspectRatio = 0.5;
|
auto maxAllowedAspectRatio = 0.5;
|
||||||
if (aspectRatio < maxAllowedAspectRatio) { // cover is too tall, e.g. webtoon
|
if (aspectRatio < maxAllowedAspectRatio) { // cover is too tall, e.g. webtoon
|
||||||
scaled = cover.scaledToHeight(1220, Qt::SmoothTransformation);
|
scaled = cover.scaledToHeight(960, Qt::SmoothTransformation);
|
||||||
} else {
|
} else {
|
||||||
scaled = cover.scaledToWidth(640, Qt::SmoothTransformation);
|
scaled = cover.scaledToWidth(480, Qt::SmoothTransformation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scaled.save(_target, "WEBP", 75);
|
scaled.save(_target, 0, 75);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user