aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-02-12 20:40:44 +0100
committerBart Visscher <bartv@thisnet.nl>2012-02-12 20:40:52 +0100
commit5c816c0cc93094b1ad6ca841e89dc5fe579b70b6 (patch)
treefdb5e90ba4d3b98ebadae2ba63e53892f7709133
parent125cf79a377a1073d18e6c609da9a6fcee64677b (diff)
downloadnextcloud-server-5c816c0cc93094b1ad6ca841e89dc5fe579b70b6.tar.gz
nextcloud-server-5c816c0cc93094b1ad6ca841e89dc5fe579b70b6.zip
Contacts: Optimize thumbnail cache handling a bit
-rw-r--r--apps/contacts/thumbnail.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/contacts/thumbnail.php b/apps/contacts/thumbnail.php
index 0cdd0a86c74..c020c29ac8c 100644
--- a/apps/contacts/thumbnail.php
+++ b/apps/contacts/thumbnail.php
@@ -43,11 +43,12 @@ $id = $_GET['id'];
$contact = OC_Contacts_App::getContactVCard($id);
// invalid vcard
-if( is_null($contact)){
+if(is_null($contact)){
OC_Log::write('contacts','thumbnail.php. The VCard for ID '.$id.' is not RFC compatible',OC_Log::ERROR);
getStandardImage();
exit();
}
+OC_Contacts_App::setLastModifiedHeader($contact);
$thumbnail_size = 23;
@@ -56,12 +57,12 @@ $image = new OC_Image();
$photo = $contact->getAsString('PHOTO');
OC_Response::setETagHeader(md5($photo));
-OC_Contacts_App::setLastModifiedHeader($contact);
if($image->loadFromBase64($photo)) {
if($image->centerCrop()) {
if($image->resize($thumbnail_size)) {
if($image->show()) {
+ // done
exit();
} else {
OC_Log::write('contacts','thumbnail.php. Couldn\'t display thumbnail for ID '.$id,OC_Log::ERROR);