From: Flavio Date: Tue, 29 Jan 2013 11:59:39 +0000 (+0100) Subject: Thumb scaling optimization X-Git-Tag: 2.0~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a625ceb37d3cf0e0551efedd0939ee36947d73ff;p=minitube Thumb scaling optimization --- 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(); }