1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

* Generate square album covers, too.

This commit is contained in:
Christian Muehlhaeuser 2012-12-09 07:54:31 +01:00
parent 51c184d62f
commit 73ef7e2a4b
2 changed files with 7 additions and 3 deletions

View File

@ -27,6 +27,7 @@
#include "Query.h"
#include "Source.h"
#include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h"
#include <QReadWriteLock>
@ -229,8 +230,11 @@ Album::cover( const QSize& size, bool forceLoad ) const
if ( !m_cover && !m_coverBuffer.isEmpty() )
{
m_cover = new QPixmap();
m_cover->loadFromData( m_coverBuffer );
QPixmap cover;
cover.loadFromData( m_coverBuffer );
m_coverBuffer.clear();
m_cover = new QPixmap( TomahawkUtils::squareCenterPixmap( cover ) );
}
if ( m_cover && !m_cover->isNull() && !size.isEmpty() )

View File

@ -93,12 +93,12 @@ private:
QString m_sortname;
artist_ptr m_artist;
QByteArray m_coverBuffer;
bool m_coverLoaded;
mutable bool m_coverLoading;
mutable QString m_uuid;
mutable QByteArray m_coverBuffer;
#ifndef ENABLE_HEADLESS
mutable QPixmap* m_cover;
mutable QHash< int, QPixmap > m_coverCache;