-
-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
Description
action::handleMediaUploaded() calls indexer::indexImage() with 2 params,
dokuwiki-plugin-spatialhelper/action.php
Lines 319 to 346 in 61a47e2
| /** | |
| * add media to spatial index. | |
| * | |
| * @param Doku_Event $event | |
| * event object by reference | |
| * @param unknown $param | |
| */ | |
| public function handleMediaUploaded(Doku_Event &$event, $param) { | |
| // data[0] temporary file name (read from $_FILES) | |
| // data[1] file name of the file being uploaded | |
| // data[2] future directory id of the file being uploaded | |
| // data[3] the mime type of the file being uploaded | |
| // data[4] true if the uploaded file exists already | |
| // data[5] (since 2011-02-06) the PHP function used to move the file to the correct location | |
| dbglog($event->data, "handleMediaUploaded::event data"); | |
| // check the list of mimetypes | |
| // if it's a supported type call appropriate index function | |
| if(substr_compare($event->data [3], 'image/jpeg', 0)) { | |
| $indexer = plugin_load('helper', 'spatialhelper_index'); | |
| if($indexer) { | |
| $indexer->indexImage($event->data [2], $event->data [1]); | |
| } | |
| } | |
| // TODO add image/tiff | |
| // TODO kml, gpx, geojson... | |
| } |
but indexer only has 1 defined...
dokuwiki-plugin-spatialhelper/helper/index.php
Lines 188 to 205 in 61a47e2
| /** | |
| * Add an index entry for this file having EXIF / IPTC data. | |
| * | |
| * @param unknown_type $img Dokuwiki image | |
| * @return boolean true when image was succesfully added to the index. | |
| * @see http://php.net/manual/en/function.exif-read-data.php | |
| * | |
| * @see http://www.php.net/manual/en/function.iptcparse.php | |
| */ | |
| public function indexImage($img) { | |
| // test for supported files (jpeg only) | |
| if( | |
| (substr($img ['file'], -strlen('.jpg')) !== '.jpg') and | |
| (substr($img ['file'], -strlen('.jpeg')) !== '.jpeg')) { | |
| return false; | |
| } | |
| $geometry = $this->getCoordsFromExif($img ['id']); |