[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdegraphics/kfile-plugins/jpeg
From:       Stephan Kulow <coolo () kde ! org>
Date:       2004-10-08 9:22:59
Message-ID: 20041008092259.39FA29003 () office ! kde ! org
[Download RAW message or body]

CVS commit by coolo: 

against public belief "Flash" is no bool in EXIF
CCMAIL: kukuk@suse.de


  M +4 -5      exif.cpp   1.9
  M +34 -3     kfile_jpeg.cpp   1.22


--- kdegraphics/kfile-plugins/jpeg/exif.cpp  #1.8:1.9
@@ -576,5 +576,5 @@ void ExifData::ProcessExifDir(unsigned c
             case TAG_FOCALLENGTH:
                 // Nice digital cameras actually save the focal length as a function
-                // of how farthey are zoomed in.
+                // of how far they are zoomed in.
                 ExifData::FocalLength = (float)ConvertAnyFormat(ValuePtr, Format);
                 break;
@@ -602,7 +602,5 @@ void ExifData::ProcessExifDir(unsigned c
 
             case TAG_FLASH:
-                if (ConvertAnyFormat(ValuePtr, Format)){
-                    ExifData::FlashUsed = 1;
-                }
+                ExifData::FlashUsed = (int)ConvertAnyFormat(ValuePtr, Format);
                 break;
 
@@ -823,4 +821,5 @@ void ExifData::process_EXIF(unsigned cha
     // Compute the CCD width, in milimeters.
     if (FocalplaneXRes != 0){
+        kdDebug() << "ExifImageWidth " << ExifImageWidth << " FocalplaneUnits " << \
                FocalplaneUnits << " FocalplaneXRes " << FocalplaneXRes << endl;
         ExifData::CCDWidth = (float)(ExifImageWidth * FocalplaneUnits / \
FocalplaneXRes);  }
@@ -858,5 +857,5 @@ ExifData::ExifData()
     ExifData::Whitebalance = -1;
     ExifData::MeteringMode = -1;
-    ExifData::FlashUsed = -1;
+    ExifData::FlashUsed = 0;
     Orientation = 0;
     Height = 0;

--- kdegraphics/kfile-plugins/jpeg/kfile_jpeg.cpp  #1.21:1.22
@@ -92,5 +92,5 @@ KJpegPlugin::KJpegPlugin(QObject *parent
 
   item = addItemInfo( exifGroup, "Flash used", i18n("Flash Used"),
-                      QVariant::Bool );
+                      QVariant::String );
   item = addItemInfo( exifGroup, "Focal length", i18n("Focal Length"),
                       QVariant::String );
@@ -248,8 +248,39 @@ bool KJpegPlugin::readInfo( KFileMetaInf
                 i18n("Color") : i18n("Black and white") );
 
-    int flashUsed = ImageInfo.getFlashUsed(); // -1, 0, 1
+    int flashUsed = ImageInfo.getFlashUsed(); // -1, <set>
     if ( flashUsed >= 0 ) {
+         QString flash = i18n("Flash", "(unknown)");
+         switch ( flashUsed ) {
+         case 0: flash = i18n("Flash", "No");
+             break;
+         case 1:
+         case 5:
+         case 7:
+             flash = i18n("Flash", "Fired");
+             break;
+         case 9:
+         case 13:
+         case 15:
+             flash = i18n( "Flash", "Fill Fired" );
+             break;
+         case 16:
+             flash = i18n( "Flash", "Off" );
+             break;
+         case 24:
+             flash = i18n( "Flash", "Auto Off" );
+             break;
+         case 25:
+         case 29:
+         case 31:
+             flash = i18n( "Flash", "Auto Fired" );
+             break;
+         case 32:
+             flash = i18n( "Flash", "Not Available" );
+             break;
+         default:
+             break;
+        }
         appendItem( exifGroup, "Flash used",
-                    QVariant((flashUsed > 0), 42 ) );
+                    flash );
     }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic