[tracker] tracker-extract: PDF extractor. Bugfix for NB#168742 (invalid date strings)



commit ba1e53d836515e21074d2313617ecb76c2f45bd5
Author: Philip Van Hoof <philip codeminded be>
Date:   Thu May 13 15:09:30 2010 +0200

    tracker-extract: PDF extractor. Bugfix for NB#168742 (invalid date strings)

 src/tracker-extract/tracker-extract-pdf.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-pdf.cpp b/src/tracker-extract/tracker-extract-pdf.cpp
index b7a35be..8bac863 100644
--- a/src/tracker-extract/tracker-extract-pdf.cpp
+++ b/src/tracker-extract/tracker-extract-pdf.cpp
@@ -501,6 +501,7 @@ extract_pdf (const gchar          *uri,
 	PDFDoc *document;
 	gchar *content;
 	guint n_words;
+	gchar *creation_date = NULL;
 	Object obj;
 	Catalog *catalog;
 
@@ -554,7 +555,8 @@ extract_pdf (const gchar          *uri,
 		pd.author = info_dict_get_string (info_dict, "Author");
 		pd.subject = info_dict_get_string (info_dict, "Subject");
 		pd.keywords = info_dict_get_string (info_dict, "Keywords");
-		pd.creation_date = info_dict_get_string (info_dict, "CreationDate");
+		creation_date = tracker_date_guess (info_dict_get_string (info_dict, "CreationDate"));
+		pd.creation_date = creation_date;
 	}
 	obj.free ();
 
@@ -795,6 +797,7 @@ extract_pdf (const gchar          *uri,
 
 	read_outline (document, metadata);
 
+	g_free (creation_date);
 	delete document;
 }
 



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