mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Generate square album covers, too.
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
#include "Query.h"
|
#include "Query.h"
|
||||||
#include "Source.h"
|
#include "Source.h"
|
||||||
|
|
||||||
|
#include "utils/TomahawkUtilsGui.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
#include <QReadWriteLock>
|
#include <QReadWriteLock>
|
||||||
@@ -229,8 +230,11 @@ Album::cover( const QSize& size, bool forceLoad ) const
|
|||||||
|
|
||||||
if ( !m_cover && !m_coverBuffer.isEmpty() )
|
if ( !m_cover && !m_coverBuffer.isEmpty() )
|
||||||
{
|
{
|
||||||
m_cover = new QPixmap();
|
QPixmap cover;
|
||||||
m_cover->loadFromData( m_coverBuffer );
|
cover.loadFromData( m_coverBuffer );
|
||||||
|
m_coverBuffer.clear();
|
||||||
|
|
||||||
|
m_cover = new QPixmap( TomahawkUtils::squareCenterPixmap( cover ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_cover && !m_cover->isNull() && !size.isEmpty() )
|
if ( m_cover && !m_cover->isNull() && !size.isEmpty() )
|
||||||
|
@@ -93,12 +93,12 @@ private:
|
|||||||
QString m_sortname;
|
QString m_sortname;
|
||||||
|
|
||||||
artist_ptr m_artist;
|
artist_ptr m_artist;
|
||||||
QByteArray m_coverBuffer;
|
|
||||||
|
|
||||||
bool m_coverLoaded;
|
bool m_coverLoaded;
|
||||||
mutable bool m_coverLoading;
|
mutable bool m_coverLoading;
|
||||||
mutable QString m_uuid;
|
mutable QString m_uuid;
|
||||||
|
|
||||||
|
mutable QByteArray m_coverBuffer;
|
||||||
#ifndef ENABLE_HEADLESS
|
#ifndef ENABLE_HEADLESS
|
||||||
mutable QPixmap* m_cover;
|
mutable QPixmap* m_cover;
|
||||||
mutable QHash< int, QPixmap > m_coverCache;
|
mutable QHash< int, QPixmap > m_coverCache;
|
||||||
|
Reference in New Issue
Block a user