mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-11-29 11:24:11 +01:00
Less aggressive caching on thumbnails too.
This commit is contained in:
parent
6daf7c9e68
commit
3877f9ff70
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user