Skip to content
Snippets Groups Projects
Commit fce614b8 authored by Thomas Tanghus's avatar Thomas Tanghus
Browse files

Less aggressive caching on thumbnails too.

parent 68670bcc
No related branches found
No related tags found
No related merge requests found
......@@ -20,14 +20,12 @@
*
*/
// Init owncloud
OCP\JSON::checkLoggedIn();
//OCP\User::checkLoggedIn();
OCP\App::checkAppEnabled('contacts');
function getStandardImage(){
OCP\Response::setExpiresHeader('P10D');
//OCP\Response::setExpiresHeader('P10D');
OCP\Response::enableCaching();
OCP\Response::redirect(OCP\Util::imagePath('contacts', 'person.png'));
}
......@@ -59,12 +57,10 @@ $image = new OC_Image();
$photo = $contact->getAsString('PHOTO');
if($photo) {
OCP\Response::setETagHeader(md5($photo));
if($image->loadFromBase64($photo)) {
if($image->centerCrop()) {
if($image->resize($thumbnail_size)) {
if($image->show()) {
// done
exit();
} else {
OCP\Util::writeLog('contacts','thumbnail.php. Couldn\'t display thumbnail for ID '.$id,OCP\Util::ERROR);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment