aboutsummaryrefslogtreecommitdiffstats
path: root/include/photo/photo_gd.php
diff options
context:
space:
mode:
authormrjive <mrjive@mrjive.it>2016-01-14 09:30:50 +0100
committermrjive <mrjive@mrjive.it>2016-01-14 09:30:50 +0100
commit5c937c5642e87750b55e15c9d9c1b863e5d5cfc1 (patch)
tree5ef2c09452b4d511f895d0fa3164fb614307f8c4 /include/photo/photo_gd.php
parent3206a46a9297dcbdc56c25512767dfb5bf66837b (diff)
parente500a08f152d641f60c7146c6a290042bdd37a73 (diff)
downloadvolse-hubzilla-5c937c5642e87750b55e15c9d9c1b863e5d5cfc1.tar.gz
volse-hubzilla-5c937c5642e87750b55e15c9d9c1b863e5d5cfc1.tar.bz2
volse-hubzilla-5c937c5642e87750b55e15c9d9c1b863e5d5cfc1.zip
Merge pull request #15 from redmatrix/master
updating from original codebase
Diffstat (limited to 'include/photo/photo_gd.php')
-rw-r--r--include/photo/photo_gd.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/photo/photo_gd.php b/include/photo/photo_gd.php
index 2ac7287e4..24bdc204f 100644
--- a/include/photo/photo_gd.php
+++ b/include/photo/photo_gd.php
@@ -108,6 +108,23 @@ class photo_gd extends photo_driver {
$this->setDimensions();
}
+ public function cropImageRect($maxx,$maxy,$x,$y,$w,$h) {
+ if(!$this->is_valid())
+ return FALSE;
+
+ $dest = imagecreatetruecolor( $maxx, $maxy );
+ imagealphablending($dest, false);
+ imagesavealpha($dest, true);
+ if ($this->type=='image/png') imagefill($dest, 0, 0, imagecolorallocatealpha($dest, 0, 0, 0, 127)); // fill with alpha
+ imagecopyresampled($dest, $this->image, 0, 0, $x, $y, $maxx, $maxy, $w, $h);
+ if($this->image)
+ imagedestroy($this->image);
+ $this->image = $dest;
+ $this->setDimensions();
+ }
+
+
+
public function imageString() {
if(!$this->is_valid())
return FALSE;