[tracker/tracker-0.6] Performance improvements to jpeg extraction



commit ac1b544ab330d92a76fbc5d6292b71c1f7180997
Author: Mikael Ottela <mikael ottela ixonos com>
Date:   Tue Apr 21 01:00:10 2009 +0300

    Performance improvements to jpeg extraction
    
    We now do much less unnecessary formatting using libexif for better
    performance.
---
 src/tracker-extract/tracker-extract-jpeg.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/tracker-extract/tracker-extract-jpeg.c b/src/tracker-extract/tracker-extract-jpeg.c
index dc6b340..a78babb 100644
--- a/src/tracker-extract/tracker-extract-jpeg.c
+++ b/src/tracker-extract/tracker-extract-jpeg.c
@@ -237,7 +237,12 @@ read_exif (const unsigned char *buffer,
 	ExifData *exif;
 	TagType  *p;
 
-	exif = exif_data_new_from_data ((unsigned char *) buffer, len);
+	exif = exif_data_new();
+	exif_data_set_option (exif, EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS);
+	exif_data_unset_option (exif, EXIF_DATA_OPTION_FOLLOW_SPECIFICATION);
+	exif_data_set_option (exif, EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE);
+
+	exif_data_load_data (exif, (unsigned char *) buffer, len);
 
 	for (p = tags; p->name; ++p) {
 		ExifEntry *entry;
@@ -296,7 +301,7 @@ extract_jpeg (const gchar *filename,
 #ifdef HAVE_LIBIPTCDATA
 		gsize  offset;
 		gsize  sublen;
-#endif /* HAVE_LIBEXIF */
+#endif /* HAVE_LIBIPTCDATA */
 
 		cinfo.err = jpeg_std_error (&tejerr.jpeg);
 		tejerr.jpeg.error_exit = tracker_extract_jpeg_error_exit;



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