From 4177219f67fb73718287b4b8b27fdaac1fdc1129 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Mon, 6 Apr 2015 19:08:58 +0200 Subject: [PATCH] Added code documentation --- php/modules/Photo.php | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/php/modules/Photo.php b/php/modules/Photo.php index d02d676..15cc9c4 100755 --- a/php/modules/Photo.php +++ b/php/modules/Photo.php @@ -327,6 +327,16 @@ class Photo extends Module { private function createMedium($url, $filename, $width, $height) { + # Function creates a smaller version of a photo when its size is bigger than a preset size + # Excepts the following: + # (string) $url = Path to the photo-file + # (string) $filename = Name of the photo-file + # (int) $width = Width of the photo + # (int) $height = Height of the photo + # Returns the following + # (boolean) true = Success + # (boolean) false = Failure + # Check dependencies self::dependencies(isset($this->database, $this->settings, $url, $filename, $width, $height)); @@ -397,6 +407,14 @@ class Photo extends Module { public function adjustFile($path, $info) { + # Function rotates and flips a photo based on its EXIF orientation + # Excepts the following: + # (string) $path = Path to the photo-file + # (array) $info = ['orientation', 'width', 'height'] + # Returns the following + # (array) $info = ['orientation', 'width', 'height'] = Success + # (boolean) false = Failure + # Check dependencies self::dependencies(isset($path, $info)); @@ -528,9 +546,11 @@ class Photo extends Module { public static function prepareData($data) { - # This function requires the following photo-attributes and turns them - # into a front-end friendly format: id, title, tags, public, star, album, thumbUrl, takestamp, url - # Note that some attributes remain unchanged + # Function turns photo-attributes into a front-end friendly format. Note that some attributes remain unchanged. + # Excepts the following: + # (array) $data = ['id', 'title', 'tags', 'public', 'star', 'album', 'thumbUrl', 'takestamp', 'url'] + # Returns the following: + # (array) $photo # Check dependencies self::dependencies(isset($data));