From a625ceb37d3cf0e0551efedd0939ee36947d73ff Mon Sep 17 00:00:00 2001 From: Flavio Date: Tue, 29 Jan 2013 12:59:39 +0100 Subject: [PATCH] Thumb scaling optimization --- src/playlistitemdelegate.cpp | 2 +- src/video.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/playlistitemdelegate.cpp b/src/playlistitemdelegate.cpp index 32048e0..79b2304 100644 --- a/src/playlistitemdelegate.cpp +++ b/src/playlistitemdelegate.cpp @@ -97,7 +97,7 @@ void PlaylistItemDelegate::paintBody( QPainter* painter, const Video *video = videoPointer.data(); // thumb - painter->drawPixmap(0, 0, THUMB_WIDTH, THUMB_HEIGHT, video->thumbnail()); + painter->drawPixmap(0, 0, video->thumbnail()); // play icon overlayed on the thumb if (isActive) diff --git a/src/video.cpp b/src/video.cpp index 9cb9017..1e65242 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -58,6 +58,7 @@ void Video::loadThumbnail() { void Video::setThumbnail(QByteArray bytes) { m_thumbnail.loadFromData(bytes); + m_thumbnail = m_thumbnail.scaled(160, 90); emit gotThumbnail(); } -- 2.39.5