Generate multiple avatar sizes for better performance loading and frugal traffic

This commit is contained in:
Čarodej
2021-11-03 16:28:14 +01:00
parent dc8ec5f20b
commit f139dbae08
30 changed files with 280 additions and 152 deletions

View File

@@ -30,9 +30,11 @@ class VisitorGetThumbnailController extends Controller
// Check ability to access protected share files
($this->protectShareRecord)($shared);
$originalFileName = substr($filename, 3);
// Get file record
$file = UserFile::where('user_id', $shared->user_id)
->where('thumbnail', $filename)
->where('basename', $originalFileName)
->firstOrFail();
// Check file access
@@ -44,7 +46,7 @@ class VisitorGetThumbnailController extends Controller
user_id: $shared->user_id,
);
// Finally download thumbnail
return ($this->downloadThumbnail)($file, $shared->user_id);
// Finally, download thumbnail
return ($this->downloadThumbnail)($filename, $file);
}
}