diff options
author | Klaus Weidenbach <Klaus.Weidenbach@gmx.net> | 2019-02-11 23:59:43 +0100 |
---|---|---|
committer | Klaus Weidenbach <Klaus.Weidenbach@gmx.net> | 2019-02-14 22:06:42 +0100 |
commit | b9df4c99cf9fcd1b16757309b4206ad084376aa2 (patch) | |
tree | 14cf94cc9c2c7f617ecc1b470d5ff5662dd38fb6 /Zotlabs/Photo/PhotoGd.php | |
parent | e6dadb215e9e08491ae57ab851960a0973d3f704 (diff) | |
download | volse-hubzilla-b9df4c99cf9fcd1b16757309b4206ad084376aa2.tar.gz volse-hubzilla-b9df4c99cf9fcd1b16757309b4206ad084376aa2.tar.bz2 volse-hubzilla-b9df4c99cf9fcd1b16757309b4206ad084376aa2.zip |
Remove duplicate code in PhotoDriver classes.
cropImage is just a special case of cropImageRect, no need to
duplicate all the code.
Diffstat (limited to 'Zotlabs/Photo/PhotoGd.php')
-rw-r--r-- | Zotlabs/Photo/PhotoGd.php | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/Zotlabs/Photo/PhotoGd.php b/Zotlabs/Photo/PhotoGd.php index 1143c565c..4054e1866 100644 --- a/Zotlabs/Photo/PhotoGd.php +++ b/Zotlabs/Photo/PhotoGd.php @@ -119,24 +119,6 @@ class PhotoGd extends PhotoDriver { $this->setDimensions(); // Shouldn't really be necessary } - public function cropImage($max, $x, $y, $w, $h) { - if(!$this->is_valid()) - return false; - - $dest = imagecreatetruecolor($max, $max); - 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, $max, $max, $w, $h); - if($this->image) - imagedestroy($this->image); - - $this->image = $dest; - $this->setDimensions(); - } - public function cropImageRect($maxx, $maxy, $x, $y, $w, $h) { if(! $this->is_valid()) return false; |