(Ed: I'm not an expert - I'm creating these "under the hood" pages in the hope that a) better coders than me will stop by and correct them, and b) other coders like me have a better place to start on some commonly-done coding tasks)
You can store and link to images in Ushahidi 2.X. For instance, creating a report gives you the option of storing images associated with it. But how does this work "under the hood", and what's a good way to replicate this, say as part of a custom install.
- The Ushahidi2.X code that saves a file (or group of files in the _FILES[$file] object attached to a GET/POST response) lives in application/helpers/upload.php, function save().
- Other commonly-used pieces of image-handling code include resizing, e.g. this code (from application/helpers/reports.php function save_media()) that resizes a saved image with name $filename and saves it as a new image with name $newfilename, in directory upload.directory:
Image::factory($filename)
->resize(89,59,Image::HEIGHT)
->save(Kohana::config('upload.directory', TRUE).$newfilename);