Diffstat (limited to 'libopie2/opiemm/oimagescrollview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiemm/oimagescrollview.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libopie2/opiemm/oimagescrollview.cpp b/libopie2/opiemm/oimagescrollview.cpp index 56be10b..37a1ad5 100644 --- a/libopie2/opiemm/oimagescrollview.cpp +++ b/libopie2/opiemm/oimagescrollview.cpp @@ -1,12 +1,13 @@ #include "oimagescrollview.h" #include <opie2/oimagezoomer.h> #include <opie2/odebug.h> #include <opie2/oapplication.h> #include <opie2/owait.h> +#include <opie2/opieexif.h> #include <qimage.h> #include <qlayout.h> /* for usage with the bitset */ #define AUTO_SCALE 0 @@ -84,24 +85,29 @@ void OImageScrollView::loadJpeg(bool interncall) if (m_lastName.isEmpty()) return; QImageIO iio( m_lastName, 0l ); QString param; bool real_load = false; if (AutoScale()) { if (!interncall) { + ExifData xf; + bool scanned = xf.scan(m_lastName); int wid, hei; wid = QApplication::desktop()->width(); hei = QApplication::desktop()->height(); if (hei>wid) { wid = hei; } else { hei = wid; } + if ( (scanned && (wid<xf.getWidth()||hei<xf.getHeight()))||!scanned ) { param = QString( "Fast Shrink( 3 ) Scale( %1, %2, ScaleMin)" ).arg( wid ).arg( hei ); odebug << "Load jpeg scaled \"" << param << "\"" << oendl; iio.setParameters(param.latin1()); setImageScaledLoaded(true); + } + real_load = true; } } else { if (ImageScaledLoaded()||!interncall) { odebug << "Load jpeg unscaled" << oendl; real_load = true; |