aboutsummaryrefslogtreecommitdiffstats
path: root/include/photo/photo_driver.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-11-15 10:48:24 +0100
committerMario Vavti <mario@mariovavti.com>2017-11-15 10:48:24 +0100
commit601f1eb624fce19a1da966e0e102b208a6ae7b74 (patch)
treec056ad6dd6a173d342b6b86252e086e7d68271da /include/photo/photo_driver.php
parent301b41eaa4f3087624a57d1471f76d903c604a5b (diff)
parent8e534918672c2ccf3614623b8bd368d18318f453 (diff)
downloadvolse-hubzilla-601f1eb624fce19a1da966e0e102b208a6ae7b74.tar.gz
volse-hubzilla-601f1eb624fce19a1da966e0e102b208a6ae7b74.tar.bz2
volse-hubzilla-601f1eb624fce19a1da966e0e102b208a6ae7b74.zip
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include/photo/photo_driver.php')
-rw-r--r--include/photo/photo_driver.php16
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;
}