Skip to content

action::handleMediaUploaded() calls indexer::indexImage() with 2 params, but indexer only has 1 #24

@mprins

Description

@mprins

action::handleMediaUploaded() calls indexer::indexImage() with 2 params,

/**
* 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...

/**
* 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']);

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions