diff options
author | zotlabs <mike@macgirvin.com> | 2017-11-14 17:39:33 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-11-14 17:39:33 -0800 |
commit | 8e534918672c2ccf3614623b8bd368d18318f453 (patch) | |
tree | 10af0a71d36279b4349d3d8afc3ba3be3f25b48b /include/photo | |
parent | 3c3c0ed34269cecdbda1288eab5b63c664a8859c (diff) | |
download | volse-hubzilla-8e534918672c2ccf3614623b8bd368d18318f453.tar.gz volse-hubzilla-8e534918672c2ccf3614623b8bd368d18318f453.tar.bz2 volse-hubzilla-8e534918672c2ccf3614623b8bd368d18318f453.zip |
sort out a few more large image upload issues
Diffstat (limited to 'include/photo')
-rw-r--r-- | include/photo/photo_driver.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 5eb1f9113..21431e96f 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -309,6 +309,11 @@ abstract class photo_driver { public function save($arr) { + if(! $this->is_valid()) { + logger('attempt to store invalid photo.'); + return false; + } + $p = array(); $p['aid'] = ((intval($arr['aid'])) ? intval($arr['aid']) : 0); @@ -331,6 +336,8 @@ abstract class photo_driver { $p['os_path'] = $arr['os_path']; $p['os_syspath'] = ((array_key_exists('os_syspath',$arr)) ? $arr['os_syspath'] : ''); $p['display_path'] = (($arr['display_path']) ? $arr['display_path'] : ''); + $p['width'] = (($arr['width']) ? $arr['width'] : $this->getWidth()); + $p['height'] = (($arr['height']) ? $arr['height'] : $this->getHeight()); if(! intval($p['imgscale'])) logger('save: ' . print_r($arr,true), LOGGER_DATA); @@ -378,8 +385,8 @@ abstract class photo_driver { dbesc(basename($p['filename'])), dbesc($this->getType()), dbesc($p['album']), - intval($this->getHeight()), - intval($this->getWidth()), + intval($p['height']), + intval($p['width']), (intval($p['os_storage']) ? dbescbin($p['os_syspath']) : dbescbin($this->imageString())), intval($p['os_storage']), intval(strlen($this->imageString())), @@ -409,8 +416,8 @@ abstract class photo_driver { dbesc(basename($p['filename'])), dbesc($this->getType()), dbesc($p['album']), - intval($this->getHeight()), - intval($this->getWidth()), + intval($p['height']), + intval($p['width']), (intval($p['os_storage']) ? dbescbin($p['os_syspath']) : dbescbin($this->imageString())), intval($p['os_storage']), intval(strlen($this->imageString())), @@ -426,6 +433,7 @@ abstract class photo_driver { dbesc($p['deny_gid']) ); } + logger('photo save ' . $p['imgscale'] . ' returned ' . intval($r)); return $r; } |