mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 11:35:24 +01:00
Don't scale album art when saving it to /tmp. Fixes issue #1096
This commit is contained in:
parent
85d1f16c5e
commit
c133a8db7c
@ -37,6 +37,7 @@ AlbumCoverLoader::AlbumCoverLoader(QObject* parent)
|
||||
: QObject(parent),
|
||||
stop_requested_(false),
|
||||
height_(120),
|
||||
scale_(true),
|
||||
padding_(true),
|
||||
next_id_(0),
|
||||
network_(new NetworkAccessManager(this))
|
||||
@ -213,8 +214,13 @@ QImage AlbumCoverLoader::ScaleAndPad(const QImage &image) const {
|
||||
return image;
|
||||
|
||||
// Scale the image down
|
||||
QImage copy = image.scaled(QSize(height_, height_),
|
||||
Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
QImage copy;
|
||||
if (scale_) {
|
||||
copy = image.scaled(QSize(height_, height_),
|
||||
Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
} else {
|
||||
copy = image;
|
||||
}
|
||||
|
||||
if (!padding_)
|
||||
return copy;
|
||||
|
@ -40,6 +40,7 @@ class AlbumCoverLoader : public QObject {
|
||||
static QString ImageCacheDir();
|
||||
|
||||
void SetDesiredHeight(int height) { height_ = height; }
|
||||
void SetScaleOutputImage(bool scale) { scale_ = scale; }
|
||||
void SetPadOutputImage(bool padding) { padding_ = padding; }
|
||||
void SetDefaultOutputImage(const QImage& image);
|
||||
|
||||
@ -100,6 +101,7 @@ class AlbumCoverLoader : public QObject {
|
||||
bool stop_requested_;
|
||||
|
||||
int height_;
|
||||
bool scale_;
|
||||
bool padding_;
|
||||
QImage default_;
|
||||
|
||||
|
@ -36,7 +36,8 @@ ArtLoader::~ArtLoader() {
|
||||
}
|
||||
|
||||
void ArtLoader::Initialised() {
|
||||
cover_loader_->Worker()->SetPadOutputImage(true);
|
||||
cover_loader_->Worker()->SetScaleOutputImage(false);
|
||||
cover_loader_->Worker()->SetPadOutputImage(false);
|
||||
cover_loader_->Worker()->SetDefaultOutputImage(QImage(":nocover.png"));
|
||||
connect(cover_loader_->Worker().get(), SIGNAL(ImageLoaded(quint64,QImage)),
|
||||
SLOT(TempArtLoaded(quint64,QImage)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user