]> git.sur5r.net Git - minitube/commitdiff
Thumb scaling optimization
authorFlavio <flavio@odisseo.local>
Tue, 29 Jan 2013 11:59:39 +0000 (12:59 +0100)
committerFlavio <flavio@odisseo.local>
Tue, 29 Jan 2013 11:59:39 +0000 (12:59 +0100)
src/playlistitemdelegate.cpp
src/video.cpp

index 32048e0d617419c30e0111d7745fc19c7d22396a..79b2304afc02475c403fadfa760b686914433fc7 100644 (file)
@@ -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)
index 9cb9017d895b50661c42dac19b242f758d26b41b..1e65242ca389531707ec680a974530caa2c7acbc 100644 (file)
@@ -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();
 }