aboutsummaryrefslogtreecommitdiffstats
path: root/include/photo/photo_driver.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-06-23 22:46:39 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-06-23 22:46:39 -0700
commit86588bdd6cf765d2f334168da5e056923c440aba (patch)
tree313cde1a1d577856cdc5a8a90479c7aa968ca85d /include/photo/photo_driver.php
parent1a0655f34ea9979c7a08d21344d3e0eb9eb3246d (diff)
downloadvolse-hubzilla-86588bdd6cf765d2f334168da5e056923c440aba.tar.gz
volse-hubzilla-86588bdd6cf765d2f334168da5e056923c440aba.tar.bz2
volse-hubzilla-86588bdd6cf765d2f334168da5e056923c440aba.zip
more work on photos, including os_storage for the size '0' photo and numbering duplicate filenames
Diffstat (limited to 'include/photo/photo_driver.php')
-rw-r--r--include/photo/photo_driver.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php
index 1ec031a1a..1501e6712 100644
--- a/include/photo/photo_driver.php
+++ b/include/photo/photo_driver.php
@@ -311,7 +311,11 @@ abstract class photo_driver {
$p['title'] = (($arr['title']) ? $arr['title'] : '');
$p['description'] = (($arr['description']) ? $arr['description'] : '');
$p['photo_usage'] = intval($arr['photo_usage']);
-
+ $p['os_storage'] = intval($arr['os_storage']);
+ $p['os_path'] = $arr['os_path'];
+
+ if(! intval($p['scale']))
+ logger('save: ' . print_r($arr,true));
$x = q("select id from photo where resource_id = '%s' and uid = %d and xchan = '%s' and `scale` = %d limit 1",
dbesc($p['resource_id']),
@@ -333,6 +337,7 @@ abstract class photo_driver {
`height` = %d,
`width` = %d,
`data` = '%s',
+ `os_storage` = %d,
`size` = %d,
`scale` = %d,
`photo_usage` = %d,
@@ -355,7 +360,8 @@ abstract class photo_driver {
dbesc($p['album']),
intval($this->getHeight()),
intval($this->getWidth()),
- dbescbin($this->imageString()),
+ (intval($p['os_storage']) ? dbesc($p['os_path']) : dbescbin($this->imageString())),
+ intval($p['os_storage']),
intval(strlen($this->imageString())),
intval($p['scale']),
intval($p['photo_usage']),
@@ -370,8 +376,8 @@ abstract class photo_driver {
}
else {
$r = q("INSERT INTO `photo`
- ( `aid`, `uid`, `xchan`, `resource_id`, `created`, `edited`, `filename`, type, `album`, `height`, `width`, `data`, `size`, `scale`, `photo_usage`, `title`, `description`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid` )
- VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s' )",
+ ( `aid`, `uid`, `xchan`, `resource_id`, `created`, `edited`, `filename`, type, `album`, `height`, `width`, `data`, `os_storage`, `size`, `scale`, `photo_usage`, `title`, `description`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid` )
+ VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s' )",
intval($p['aid']),
intval($p['uid']),
dbesc($p['xchan']),
@@ -383,7 +389,8 @@ abstract class photo_driver {
dbesc($p['album']),
intval($this->getHeight()),
intval($this->getWidth()),
- dbescbin($this->imageString()),
+ (intval($p['os_storage']) ? dbesc($p['os_path']) : dbescbin($this->imageString())),
+ intval($p['os_storage']),
intval(strlen($this->imageString())),
intval($p['scale']),
intval($p['photo_usage']),