From 2020bd44c18f31ca6993ffd77b8296864fb374cf Mon Sep 17 00:00:00 2001 From: conradverm Date: Fri, 19 Oct 2007 13:25:18 +0000 Subject: [PATCH] KTS-673 "The search algorithm needs some work" Updated. Added Exif extractor --- search2/indexing/extractors/ExifExtractor.inc.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+), 0 deletions(-) create mode 100644 search2/indexing/extractors/ExifExtractor.inc.php diff --git a/search2/indexing/extractors/ExifExtractor.inc.php b/search2/indexing/extractors/ExifExtractor.inc.php new file mode 100644 index 0000000..12311fa --- /dev/null +++ b/search2/indexing/extractors/ExifExtractor.inc.php @@ -0,0 +1,50 @@ +sourcefile, 0, true); + $content = ''; + foreach ($exif as $key => $section) + { + foreach ($section as $name => $val) + { + if (is_numeric($val)) + { + // no point indexing numeric content. it will be ignored anyways! + continue; + } + $content .= "$val\n"; + } + } + + $result = file_put_contents($this->targetfile, $content); + + return false !== $result; + } + + public function diagnose() + { + if (!function_exists('exif_read_data')) + { + return sprintf(_kt('The Exif extractor requires the module exif php extension. Please include this in the php.ini.')); + } + + return null; + } +} + +?> \ No newline at end of file -- libgit2 0.21.4