summaryrefslogtreecommitdiff
authoralwin <alwin>2004-11-06 02:55:45 (UTC)
committer alwin <alwin>2004-11-06 02:55:45 (UTC)
commita93a0ee1fce8b2fb7abac475a97dac8001aed8e0 (patch) (unidiff)
tree21890174b801d6b14c67740596316847d05ffffe
parent466245b561abe1514ef37ea978b5958caefdc962 (diff)
downloadopie-a93a0ee1fce8b2fb7abac475a97dac8001aed8e0.zip
opie-a93a0ee1fce8b2fb7abac475a97dac8001aed8e0.tar.gz
opie-a93a0ee1fce8b2fb7abac475a97dac8001aed8e0.tar.bz2
moved a lot of code from opie-eye_slave into lib
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiemm/opieexif.cpp54
-rw-r--r--libopie2/opiemm/opieexif.h7
2 files changed, 12 insertions, 49 deletions
diff --git a/libopie2/opiemm/opieexif.cpp b/libopie2/opiemm/opieexif.cpp
index 0860ea8..de49937 100644
--- a/libopie2/opiemm/opieexif.cpp
+++ b/libopie2/opiemm/opieexif.cpp
@@ -279,3 +279,2 @@ int ExifData::ReadJpegSections (QFile & infile, ReadMode_t ReadMode)
279 279
280
281//-------------------------------------------------------------------------- 280//--------------------------------------------------------------------------
@@ -1011,4 +1010,3 @@ static QImage rotate_270( const QImage& img ) {
1011 1010
1012 1011QString ExifData::color_mode_to_string( bool b ) {
1013static QString color_mode_to_string( bool b ) {
1014 return b ? QObject::tr( "Colormode: Color\n" ) : QObject::tr( "Colormode: Black and white\n" ); 1012 return b ? QObject::tr( "Colormode: Color\n" ) : QObject::tr( "Colormode: Black and white\n" );
@@ -1016,3 +1014,3 @@ static QString color_mode_to_string( bool b ) {
1016 1014
1017static QString compression_to_string( int level ) { 1015QString ExifData::compression_to_string( int level ) {
1018 QString str; 1016 QString str;
@@ -1035,45 +1033,3 @@ static QString compression_to_string( int level ) {
1035 1033
1036 1034QString ExifData::white_balance_string( int i ) {
1037static QDateTime parseDateTime( const QString& string )
1038{
1039 QDateTime dt;
1040 if ( string.length() != 19 )
1041 return dt;
1042
1043 QString year = string.left( 4 );
1044 QString month = string.mid( 5, 2 );
1045 QString day = string.mid( 8, 2 );
1046 QString hour = string.mid( 11, 2 );
1047 QString minute = string.mid( 14, 2 );
1048 QString seconds = string.mid( 18, 2 );
1049
1050 bool ok;
1051 bool allOk = true;
1052 int y = year.toInt( &ok );
1053 allOk &= ok;
1054
1055 int mo = month.toInt( &ok );
1056 allOk &= ok;
1057
1058 int d = day.toInt( &ok );
1059 allOk &= ok;
1060
1061 int h = hour.toInt( &ok );
1062 allOk &= ok;
1063
1064 int mi = minute.toInt( &ok );
1065 allOk &= ok;
1066
1067 int s = seconds.toInt( &ok );
1068 allOk &= ok;
1069
1070 if ( allOk ) {
1071 dt.setDate( QDate( y, mo, d ) );
1072 dt.setTime( QTime( h, mi, s ) );
1073 }
1074
1075 return dt;
1076}
1077
1078static QString white_balance_string( int i ) {
1079 QString balance; 1035 QString balance;
@@ -1121,3 +1077,3 @@ static QString white_balance_string( int i ) {
1121 1077
1122static QString metering_mode( int i) { 1078QString ExifData::metering_mode( int i) {
1123 QString meter; 1079 QString meter;
@@ -1156,3 +1112,3 @@ static QString metering_mode( int i) {
1156 1112
1157static QString exposure_program( int i ) { 1113QString ExifData::exposure_program( int i ) {
1158 QString exp; 1114 QString exp;
diff --git a/libopie2/opiemm/opieexif.h b/libopie2/opiemm/opieexif.h
index efaed71..fb06bf8 100644
--- a/libopie2/opiemm/opieexif.h
+++ b/libopie2/opiemm/opieexif.h
@@ -134,2 +134,9 @@ public:
134 bool isNullThumbnail() { return !isThumbnailSane(); } 134 bool isNullThumbnail() { return !isThumbnailSane(); }
135
136 // some helpers
137 static QString color_mode_to_string( bool b );
138 static QString compression_to_string( int level );
139 static QString white_balance_string( int i );
140 static QString metering_mode( int i);
141 static QString exposure_program( int i );
135}; 142};