aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Getfile.php5
-rw-r--r--Zotlabs/Photo/PhotoDriver.php3
2 files changed, 5 insertions, 3 deletions
diff --git a/Zotlabs/Module/Getfile.php b/Zotlabs/Module/Getfile.php
index 5aa17b199..583cf38f0 100644
--- a/Zotlabs/Module/Getfile.php
+++ b/Zotlabs/Module/Getfile.php
@@ -110,9 +110,10 @@ class Getfile extends \Zotlabs\Web\Controller {
}
if($resolution > 0) {
- $r = q("select * from photo where resource_id = '%s' and uid = %d limit 1",
+ $r = q("SELECT * FROM photo WHERE resource_id = '%s' AND uid = %d AND imgscale = %d LIMIT 1",
dbesc($resource),
- intval($channel['channel_id'])
+ intval($channel['channel_id']),
+ $resolution
);
if($r) {
header('Content-type: ' . $r[0]['mimetype']);
diff --git a/Zotlabs/Photo/PhotoDriver.php b/Zotlabs/Photo/PhotoDriver.php
index 4c7da92cf..75117c341 100644
--- a/Zotlabs/Photo/PhotoDriver.php
+++ b/Zotlabs/Photo/PhotoDriver.php
@@ -504,10 +504,11 @@ abstract class PhotoDriver {
*/
public function storeThumbnail($arr, $scale = 0) {
+ $arr['imgscale'] = $scale;
+
if(boolval(get_config('system','filesystem_storage_thumbnails', 0)) && $scale > 0) {
$channel = \App::get_channel();
$arr['os_storage'] = 1;
- $arr['imgscale'] = $scale;
$arr['os_syspath'] = 'store/' . $channel['channel_address'] . '/' . $arr['os_path'] . '-' . $scale;
if(! $this->saveImage($arr['os_syspath']))
return false;