summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2012-11-12 11:39:04 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2012-11-12 13:04:00 +0100
commitbb56581192e062e4c8ec2aa7c0874433760e7fa9 (patch)
tree177e8ecd951a2a095927eb6d5292b205363b889e
parent43bfabf68fdbeeb71a7f66e978897fda40fdd6d3 (diff)
downloadnextcloud-server-bb56581192e062e4c8ec2aa7c0874433760e7fa9.tar.gz
nextcloud-server-bb56581192e062e4c8ec2aa7c0874433760e7fa9.zip
add php-doc
-rw-r--r--lib/image.php29
1 files 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 <http://www.gnu.org/licenses/>.
*
*/
-//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 <legendsky@hotmail.com>
+ * @link http://www.programmierer-forum.de/imagebmp-gute-funktion-gefunden-t143716.htm
+ * @author mgutt <marc@gutt.it>
+ * @version 1.00
+ * @param resource $image
+ * @param string $filename [optional] <p>The path to save the file to.</p>
+ * @param int $bit [optional] <p>Bit depth, (default is 24).</p>
+ * @param int $compression [optional]
+ * @return bool <b>TRUE</b> on success or <b>FALSE</b> 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 <p>
+ * Path to the BMP image.
+ * </p>
+ * @return resource an image resource identifier on success, <b>FALSE</b> 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;