summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/slave/thumbnailtool.cpp
Unidiff
Diffstat (limited to 'noncore/graphics/opie-eye/slave/thumbnailtool.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/slave/thumbnailtool.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/noncore/graphics/opie-eye/slave/thumbnailtool.cpp b/noncore/graphics/opie-eye/slave/thumbnailtool.cpp
index d2e169c..62bb1e6 100644
--- a/noncore/graphics/opie-eye/slave/thumbnailtool.cpp
+++ b/noncore/graphics/opie-eye/slave/thumbnailtool.cpp
@@ -28,28 +28,25 @@ static bool makeThumbDir( const QFileInfo& inf, bool make = false) {
28 * load the thumbnail 28 * load the thumbnail
29 * /foo/bar/imagefoo.gif 29 * /foo/bar/imagefoo.gif
30 * check for a png in /foo/bar/.opie-eye/%dx%d-imagefoo.gif 30 * check for a png in /foo/bar/.opie-eye/%dx%d-imagefoo.gif
31 */ 31 */
32QPixmap ThumbNailTool::getThumb( const QString& path, int width, int height ) { 32QPixmap ThumbNailTool::getThumb( const QString& path, int width, int height ) {
33 QFileInfo inf( path ); 33 QFileInfo inf( path );
34 owarn << "Get Thumb" << oendl;
35 if ( !makeThumbDir( inf ) ) { 34 if ( !makeThumbDir( inf ) ) {
36 QPixmap pix; 35 QPixmap pix;
37 return pix; 36 return pix;
38 } 37 }
39 QString str = QString( "/.opie-eye/%1x%2-%3" ).arg( width ).arg( height ).arg( inf.fileName() ); 38 QString str = QString( "/.opie-eye/%1x%2-%3" ).arg( width ).arg( height ).arg( inf.fileName() );
40 owarn << inf.dirPath()+str << oendl;
41 return QPixmap( inf.dirPath()+str,"PNG" ); 39 return QPixmap( inf.dirPath()+str,"PNG" );
42 40
43} 41}
44 42
45void ThumbNailTool::putThumb( const QString& path, const QPixmap& pix, int width, int height ) { 43void ThumbNailTool::putThumb( const QString& path, const QPixmap& pix, int width, int height ) {
46 QFileInfo inf( path ); 44 QFileInfo inf( path );
47 makeThumbDir( inf, true ); 45 makeThumbDir( inf, true );
48 QString str = QString( "/.opie-eye/%1x%2-%3" ).arg( width ).arg( height ).arg( inf.fileName() ); 46 QString str = QString( "/.opie-eye/%1x%2-%3" ).arg( width ).arg( height ).arg( inf.fileName() );
49 owarn << inf.dirPath()+str << oendl;
50 pix.save( inf.dirPath()+str, "PNG" ); 47 pix.save( inf.dirPath()+str, "PNG" );
51} 48}
52 49
53 50
54QPixmap ThumbNailTool::scaleImage( QImage& img, int w, int h ) { 51QPixmap ThumbNailTool::scaleImage( QImage& img, int w, int h ) {
55 double hs = (double)h / (double)img.height() ; 52 double hs = (double)h / (double)img.height() ;