From bb56581192e062e4c8ec2aa7c0874433760e7fa9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 12 Nov 2012 11:39:04 +0100 Subject: [PATCH] add php-doc --- lib/image.php | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/lib/image.php b/lib/image.php index 877a457f67a..50f79274d13 100644 --- a/lib/image.php +++ b/lib/image.php @@ -20,10 +20,21 @@ * License along with this library. If not, see . * */ -//From http://www.programmierer-forum.de/imagebmp-gute-funktion-gefunden-t143716.htm if ( ! function_exists( 'imagebmp') ) { + /** + * Output a BMP image to either the browser or a file + * @link http://www.ugia.cn/wp-data/imagebmp.php + * @author legend + * @link http://www.programmierer-forum.de/imagebmp-gute-funktion-gefunden-t143716.htm + * @author mgutt + * @version 1.00 + * @param resource $image + * @param string $filename [optional]

The path to save the file to.

+ * @param int $bit [optional]

Bit depth, (default is 24).

+ * @param int $compression [optional] + * @return bool TRUE on success or FALSE on failure. + */ function imagebmp($im, $filename='', $bit=24, $compression=0) { - // version 1.00 if (!in_array($bit, array(1, 4, 8, 16, 24, 32))) { $bit = 24; } @@ -130,7 +141,6 @@ if ( ! function_exists( 'imagebmp') ) { } } - //From user comments at http://dk2.php.net/manual/en/function.exif-imagetype.php if ( ! function_exists( 'exif_imagetype' ) ) { function exif_imagetype ( $filename ) { @@ -636,9 +646,16 @@ class OC_Image { } } - //From http://www.programmierer-forum.de/function-imagecreatefrombmp-laeuft-mit-allen-bitraten-t143137.htm + /** + * Create a new image from file or URL + * @link http://www.programmierer-forum.de/function-imagecreatefrombmp-laeuft-mit-allen-bitraten-t143137.htm + * @version 1.00 + * @param string $filename

+ * Path to the BMP image. + *

+ * @return resource an image resource identifier on success, FALSE on errors. + */ private function imagecreatefrombmp($filename) { - // version 1.00 if (!($fh = fopen($filename, 'rb'))) { trigger_error('imagecreatefrombmp: Can not open ' . $filename, E_USER_WARNING); return false; @@ -658,7 +675,7 @@ class OC_Image { } // set bytes and padding $meta['bytes'] = $meta['bits'] / 8; - $this->bit_depth = $meta['bits']; + $this->bit_depth = $meta['bits']; //remember the bit depth for the imagebmp call $meta['decal'] = 4 - (4 * (($meta['width'] * $meta['bytes'] / 4)- floor($meta['width'] * $meta['bytes'] / 4))); if ($meta['decal'] == 4) { $meta['decal'] = 0; -- 2.39.5