aboutsummaryrefslogtreecommitdiffstats
path: root/mod/photo.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/photo.php')
-rw-r--r--mod/photo.php17
1 files changed, 7 insertions, 10 deletions
diff --git a/mod/photo.php b/mod/photo.php
index 66280cb76..2e16fc1d9 100644
--- a/mod/photo.php
+++ b/mod/photo.php
@@ -22,14 +22,6 @@ function photo_init(&$a) {
// NOTREACHED
}
- if($photo === 'qr') {
- $t = $_GET['qr'];
- require_once('library/phpqrcode/phpqrcode.php');
- header("Content-type: image/png");
- QRcode::png(($t) ? $t : '.');
- killme();
- }
-
$observer_xchan = get_observer_hash();
$default = get_default_profile_photo();
@@ -61,14 +53,17 @@ function photo_init(&$a) {
$uid = $person;
- $r = q("SELECT * FROM photo WHERE scale = %d AND uid = %d AND profile = 1 LIMIT 1",
+ $r = q("SELECT * FROM photo WHERE scale = %d AND uid = %d AND photo_usage = %d LIMIT 1",
intval($resolution),
- intval($uid)
+ intval($uid),
+ intval(PHOTO_PROFILE)
);
if(count($r)) {
$data = dbunescbin($r[0]['data']);
$mimetype = $r[0]['type'];
}
+ if(intval($r[0]['os_storage']))
+ $data = file_get_contents($data);
if(! isset($data)) {
$data = file_get_contents($default);
$mimetype = 'image/png';
@@ -142,6 +137,8 @@ function photo_init(&$a) {
if($r && $allowed) {
$data = dbunescbin($r[0]['data']);
$mimetype = $r[0]['type'];
+ if(intval($r[0]['os_storage']))
+ $data = file_get_contents($data);
}
else {