aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2021-01-23 21:45:20 +0100
committerMax Kostikov <max@kostikov.co>2021-01-23 21:45:20 +0100
commite4ed5ed264bf660b893e18d85775f9b08c133564 (patch)
treee92bc9253085ef2d44b0bd716e0d6167d88731db /include
parent007de17702a6fd57ffc9e5f0ad28977d5c4c6697 (diff)
downloadvolse-hubzilla-e4ed5ed264bf660b893e18d85775f9b08c133564.tar.gz
volse-hubzilla-e4ed5ed264bf660b893e18d85775f9b08c133564.tar.bz2
volse-hubzilla-e4ed5ed264bf660b893e18d85775f9b08c133564.zip
Do not store multiple profile images thumbnails
Diffstat (limited to 'include')
-rw-r--r--include/photo/photo_driver.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php
index f61919eea..542d932f6 100644
--- a/include/photo/photo_driver.php
+++ b/include/photo/photo_driver.php
@@ -401,8 +401,17 @@ function import_channel_photo($photo, $type, $aid, $uid) {
logger('Importing channel photo for ' . $uid, LOGGER_DEBUG);
+ $r = q("SELECT resource_id FROM photo WHERE uid = %d AND photo_usage = %d AND imgscale = %d",
+ intval($uid),
+ intval(PHOTO_PROFILE),
+ intval(PHOTO_RES_PROFILE_300)
+ );
+ if ($r)
+ hash = $r[0]['resource_id'];
+ else
+ $hash = photo_new_resource();
+
$photo_failure = false;
- $hash = photo_new_resource();
$filename = $hash;
$img = photo_factory($photo, $type);