gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r1230 - Extractor/src/plugins/exiv2


From: grothoff
Subject: [GNUnet-SVN] r1230 - Extractor/src/plugins/exiv2
Date: Sun, 3 Jul 2005 13:16:08 -0700 (PDT)

Author: grothoff
Date: 2005-07-03 13:16:06 -0700 (Sun, 03 Jul 2005)
New Revision: 1230

Modified:
   Extractor/src/plugins/exiv2/exiv2extractor.cc
Log:
fixes

Modified: Extractor/src/plugins/exiv2/exiv2extractor.cc
===================================================================
--- Extractor/src/plugins/exiv2/exiv2extractor.cc       2005-07-03 19:52:16 UTC 
(rev 1229)
+++ Extractor/src/plugins/exiv2/exiv2extractor.cc       2005-07-03 20:16:06 UTC 
(rev 1230)
@@ -25,11 +25,10 @@
 
 #include "platform.h"
 #include "extractor.h"
-#include "convert.h"
 
-#include "exiv2/exif.hpp"
-#include "exiv2/image.hpp"
-#include "exiv2/futils.hpp"
+#include "exif.hpp"
+#include "image.hpp"
+#include "futils.hpp"
 
 #include <iostream>
 #include <iomanip>
@@ -65,11 +64,16 @@
                                         EXTRACTOR_KeywordType type,
                                         struct EXTRACTOR_Keywords * result)
 {
+    const char * str;
+        
     Exiv2::ExifKey ek(key);
     Exiv2::ExifData::const_iterator md = exifData.findKey(ek);
     if (md != exifData.end()) {
+       str = Exiv2::toString(*md).c_str();
+        while (isspace(str[0]) && (strlen(str) > 0)) str++;
+       if (strlen(str) > 0)
         result = addKeyword(type, 
-                            strdup(Exiv2::toString(*md).c_str()), 
+                            strdup(str),
                             result);
     }
     return result;
@@ -87,16 +91,7 @@
         try {
             if (!Exiv2::fileExists(filename, true)) return result;
 
-            // Filename
-            result = addKeyword(EXTRACTOR_FILENAME, strdup(filename), result);
 
-            // Filesize
-            struct stat buf;
-            if (0 == stat(filename, &buf)) {
-                result = addKeyword(EXTRACTOR_FILESIZE,
-                                    
strdup(Exiv2::toString(buf.st_size).c_str()), 
-                                    result);
-        }
 
         Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(filename);
         assert(image.get() != 0);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]