author | alwin <alwin> | 2004-11-01 19:52:25 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-11-01 19:52:25 (UTC) |
commit | 2dc92f4bfe9e81edc2b0b24ecacf3bc44b344984 (patch) (unidiff) | |
tree | b1d5661ea64931b6eeb2030ceb22532cef699a75 /libopie2/opiemm/oimagescrollview.cpp | |
parent | 5a41dcd5901badbd2e258b0a916fb012b6351eeb (diff) | |
download | opie-2dc92f4bfe9e81edc2b0b24ecacf3bc44b344984.zip opie-2dc92f4bfe9e81edc2b0b24ecacf3bc44b344984.tar.gz opie-2dc92f4bfe9e81edc2b0b24ecacf3bc44b344984.tar.bz2 |
exif class added (taken from opie-eye_slave and more c++ like reworked)
it is used in oimageview while loading jpegs checking BEFORE loading if the
image should be scaled loaded.
ToDo: documentation of the interface, remove it from opie-eye_slave (it should
use of course the library version)
Diffstat (limited to 'libopie2/opiemm/oimagescrollview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiemm/oimagescrollview.cpp | 14 |
1 files changed, 10 insertions, 4 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 | |||
@@ -3,8 +3,9 @@ | |||
3 | #include <opie2/oimagezoomer.h> | 3 | #include <opie2/oimagezoomer.h> |
4 | #include <opie2/odebug.h> | 4 | #include <opie2/odebug.h> |
5 | #include <opie2/oapplication.h> | 5 | #include <opie2/oapplication.h> |
6 | #include <opie2/owait.h> | 6 | #include <opie2/owait.h> |
7 | #include <opie2/opieexif.h> | ||
7 | 8 | ||
8 | #include <qimage.h> | 9 | #include <qimage.h> |
9 | #include <qlayout.h> | 10 | #include <qlayout.h> |
10 | 11 | ||
@@ -86,20 +87,25 @@ void OImageScrollView::loadJpeg(bool interncall) | |||
86 | QString param; | 87 | QString param; |
87 | bool real_load = false; | 88 | bool real_load = false; |
88 | if (AutoScale()) { | 89 | if (AutoScale()) { |
89 | if (!interncall) { | 90 | if (!interncall) { |
91 | ExifData xf; | ||
92 | bool scanned = xf.scan(m_lastName); | ||
90 | int wid, hei; | 93 | int wid, hei; |
91 | wid = QApplication::desktop()->width(); | 94 | wid = QApplication::desktop()->width(); |
92 | hei = QApplication::desktop()->height(); | 95 | hei = QApplication::desktop()->height(); |
93 | if (hei>wid) { | 96 | if (hei>wid) { |
94 | wid = hei; | 97 | wid = hei; |
95 | } else { | 98 | } else { |
96 | hei = wid; | 99 | hei = wid; |
97 | } | 100 | } |
98 | param = QString( "Fast Shrink( 3 ) Scale( %1, %2, ScaleMin)" ).arg( wid ).arg( hei ); | 101 | if ( (scanned && (wid<xf.getWidth()||hei<xf.getHeight()))||!scanned ) { |
99 | odebug << "Load jpeg scaled \"" << param << "\"" << oendl; | 102 | param = QString( "Fast Shrink( 3 ) Scale( %1, %2, ScaleMin)" ).arg( wid ).arg( hei ); |
100 | iio.setParameters(param.latin1()); | 103 | odebug << "Load jpeg scaled \"" << param << "\"" << oendl; |
101 | setImageScaledLoaded(true); | 104 | iio.setParameters(param.latin1()); |
105 | setImageScaledLoaded(true); | ||
106 | } | ||
107 | |||
102 | real_load = true; | 108 | real_load = true; |
103 | } | 109 | } |
104 | } else { | 110 | } else { |
105 | if (ImageScaledLoaded()||!interncall) { | 111 | if (ImageScaledLoaded()||!interncall) { |