diff options
author | zotlabs <mike@macgirvin.com> | 2018-01-23 16:36:56 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-01-23 16:36:56 -0800 |
commit | 4b7947d98c0625cfc53b481e2240a275e48c0d19 (patch) | |
tree | 6c292f51123f0c394999e03710eef9db0b8a790e /Zotlabs/Module | |
parent | c034fab4da043aceca212270f0c00fec9492e78d (diff) | |
download | volse-hubzilla-4b7947d98c0625cfc53b481e2240a275e48c0d19.tar.gz volse-hubzilla-4b7947d98c0625cfc53b481e2240a275e48c0d19.tar.bz2 volse-hubzilla-4b7947d98c0625cfc53b481e2240a275e48c0d19.zip |
replace image cropping library
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Cover_photo.php | 12 | ||||
-rw-r--r-- | Zotlabs/Module/Profile_photo.php | 21 |
2 files changed, 19 insertions, 14 deletions
diff --git a/Zotlabs/Module/Cover_photo.php b/Zotlabs/Module/Cover_photo.php index 47bce6c2b..cfb513365 100644 --- a/Zotlabs/Module/Cover_photo.php +++ b/Zotlabs/Module/Cover_photo.php @@ -64,12 +64,12 @@ class Cover_photo extends \Zotlabs\Web\Controller { $image_id = substr($image_id,0,-2); } - - $srcX = $_POST['xstart']; - $srcY = $_POST['ystart']; - $srcW = $_POST['xfinal'] - $srcX; - $srcH = $_POST['yfinal'] - $srcY; - + + + $srcX = intval($_POST['xstart']); + $srcY = intval($_POST['ystart']); + $srcW = intval($_POST['xfinal']) - $srcX; + $srcH = intval($_POST['yfinal']) - $srcY; $r = q("select gender from profile where uid = %d and is_default = 1 limit 1", intval(local_channel()) diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php index 45a606d5f..3aa6aee79 100644 --- a/Zotlabs/Module/Profile_photo.php +++ b/Zotlabs/Module/Profile_photo.php @@ -1,10 +1,11 @@ <?php namespace Zotlabs\Module; -/* @file profile_photo.php - @brief Module-file with functions for handling of profile-photos - -*/ +/* + * @file Profile_photo.php + * @brief Module-file with functions for handling of profile-photos + * + */ require_once('include/photo/photo_driver.php'); @@ -55,6 +56,10 @@ class Profile_photo extends \Zotlabs\Web\Controller { if((array_key_exists('cropfinal',$_POST)) && (intval($_POST['cropfinal']) == 1)) { + logger('crop: ' . print_r($_POST,true)); + + + // phase 2 - we have finished cropping if(argc() != 2) { @@ -86,10 +91,10 @@ class Profile_photo extends \Zotlabs\Web\Controller { } - $srcX = $_POST['xstart']; - $srcY = $_POST['ystart']; - $srcW = $_POST['xfinal'] - $srcX; - $srcH = $_POST['yfinal'] - $srcY; + $srcX = intval($_POST['xstart']); + $srcY = intval($_POST['ystart']); + $srcW = intval($_POST['xfinal']) - $srcX; + $srcH = intval($_POST['yfinal']) - $srcY; $r = q("SELECT * FROM photo WHERE resource_id = '%s' AND uid = %d AND imgscale = %d LIMIT 1", dbesc($image_id), |