summaryrefslogtreecommitdiff
authoralwin <alwin>2004-11-01 13:33:51 (UTC)
committer alwin <alwin>2004-11-01 13:33:51 (UTC)
commit915af02212ea80e43da5bcc24415e3e48778bea9 (patch) (side-by-side diff)
treeeff6dbcc2f1e62dfbb8f6ababe183306fe2077e1
parentb3153506a1be76a386f23a3af44f84042d148111 (diff)
downloadopie-915af02212ea80e43da5bcc24415e3e48778bea9.zip
opie-915af02212ea80e43da5bcc24415e3e48778bea9.tar.gz
opie-915af02212ea80e43da5bcc24415e3e48778bea9.tar.bz2
when jpeg image is smaller than requested thumbsize it will not use
scaled loading
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/slave/jpeg_slave.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/slave/jpeg_slave.cpp b/noncore/graphics/opie-eye/slave/jpeg_slave.cpp
index fb7d5de..1bb81d9 100644
--- a/noncore/graphics/opie-eye/slave/jpeg_slave.cpp
+++ b/noncore/graphics/opie-eye/slave/jpeg_slave.cpp
@@ -1417,2 +1417,4 @@ QPixmap JpegSlave::pixmap( const QString& path, int wid, int hei) {
ExifData ImageInfo;
+ /*
+ */
if ( !ImageInfo.scan( path ) || ImageInfo.isNullThumbnail() ) {
@@ -1420,4 +1422,10 @@ QPixmap JpegSlave::pixmap( const QString& path, int wid, int hei) {
QImageIO iio( path, 0l );
+ if (wid < ImageInfo.getWidth() || hei<ImageInfo.getHeight()) {
+ odebug << "Scaling "<<ImageInfo.getWidth()<<"x"<<ImageInfo.getHeight()
+ << " to "<<wid<<"x"<<hei<< " ("<<path<<")"<<oendl;
QString str = QString( "Fast Shrink( 4 ) Scale( %1, %2, ScaleFree)" ).arg( wid ).arg( hei );
iio.setParameters( str.latin1() );// will be strdupped anyway
+ } else {
+ odebug << "Not scaling "<<ImageInfo.getWidth()<<"x"<<ImageInfo.getHeight()<< " ("<<path<<")"<<oendl;
+ }
img = iio.read() ? iio.image() : QImage();