aboutsummaryrefslogtreecommitdiffstats
path: root/include/Photo.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-22 17:48:42 -0800
committerfriendica <info@friendica.com>2013-01-22 17:48:42 -0800
commitcf2488e999944ca1135ac62955527a376ad0eac2 (patch)
treec9f2981c7c340b66fe5bbc9cc76e7b981deeea45 /include/Photo.php
parentbeb3301d43c0d532bd6984ee745074479babdabb (diff)
downloadvolse-hubzilla-cf2488e999944ca1135ac62955527a376ad0eac2.tar.gz
volse-hubzilla-cf2488e999944ca1135ac62955527a376ad0eac2.tar.bz2
volse-hubzilla-cf2488e999944ca1135ac62955527a376ad0eac2.zip
clean up the photo storage backend, revamp mod/wall_upload
Diffstat (limited to 'include/Photo.php')
-rw-r--r--include/Photo.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/include/Photo.php b/include/Photo.php
index c3165cc9f..a60cfc868 100644
--- a/include/Photo.php
+++ b/include/Photo.php
@@ -523,7 +523,7 @@ class Photo {
- public function store($uid, $xchan, $rid, $filename, $album, $scale, $profile = 0, $allow_cid = '', $allow_gid = '', $deny_cid = '', $deny_gid = '') {
+ public function store($aid, $uid, $xchan, $rid, $filename, $album, $scale, $profile = 0, $allow_cid = '', $allow_gid = '', $deny_cid = '', $deny_gid = '') {
$x = q("select id from photo where `resource_id` = '%s' and uid = %d and `xchan` = '%s' and `scale` = %d limit 1",
dbesc($rid),
@@ -533,6 +533,7 @@ class Photo {
);
if(count($x)) {
$r = q("UPDATE `photo`
+ set `aid` = %d,
set `uid` = %d,
`xchan` = '%s',
`resource_id` = '%s',
@@ -544,6 +545,7 @@ class Photo {
`height` = %d,
`width` = %d,
`data` = '%s',
+ `size` = %d,
`scale` = %d,
`profile` = %d,
`allow_cid` = '%s',
@@ -552,6 +554,7 @@ class Photo {
`deny_gid` = '%s'
where id = %d limit 1",
+ intval($aid),
intval($uid),
dbesc($xchan),
dbesc($rid),
@@ -563,6 +566,7 @@ class Photo {
intval($this->getHeight()),
intval($this->getWidth()),
dbesc($this->imageString()),
+ intval(strlen($this->imageString())),
intval($scale),
intval($profile),
dbesc($allow_cid),
@@ -574,8 +578,9 @@ class Photo {
}
else {
$r = q("INSERT INTO `photo`
- ( `uid`, `xchan`, `resource_id`, `created`, `edited`, `filename`, type, `album`, `height`, `width`, `data`, `scale`, `profile`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid` )
- VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, '%s', '%s', '%s', '%s' )",
+ ( `aid`, `uid`, `xchan`, `resource_id`, `created`, `edited`, `filename`, type, `album`, `height`, `width`, `data`, `size`, `scale`, `profile`, `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' )",
+ intval($aid),
intval($uid),
dbesc($xchan),
dbesc($rid),
@@ -587,6 +592,7 @@ class Photo {
intval($this->getHeight()),
intval($this->getWidth()),
dbesc($this->imageString()),
+ intval(strlen($this->imageString())),
intval($scale),
intval($profile),
dbesc($allow_cid),
@@ -669,21 +675,21 @@ function import_profile_photo($photo,$xchan) {
$img->scaleImageSquare(175);
- $r = $img->store(0, $xchan, $hash, $filename, 'Contact Photos', 4 );
+ $r = $img->store(0, 0, $xchan, $hash, $filename, 'Contact Photos', 4 );
if($r === false)
$photo_failure = true;
$img->scaleImage(80);
- $r = $img->store(0, $xchan, $hash, $filename, 'Contact Photos', 5 );
+ $r = $img->store(0, 0, $xchan, $hash, $filename, 'Contact Photos', 5 );
if($r === false)
$photo_failure = true;
$img->scaleImage(48);
- $r = $img->store(0, $xchan, $hash, $filename, 'Contact Photos', 6 );
+ $r = $img->store(0, 0, $xchan, $hash, $filename, 'Contact Photos', 6 );
if($r === false)
$photo_failure = true;