]> source.dussan.org Git - nextcloud-server.git/commitdiff
Contacts: Optimize thumbnail cache handling a bit
authorBart Visscher <bartv@thisnet.nl>
Sun, 12 Feb 2012 19:40:44 +0000 (20:40 +0100)
committerBart Visscher <bartv@thisnet.nl>
Sun, 12 Feb 2012 19:40:52 +0000 (20:40 +0100)
apps/contacts/thumbnail.php

index 0cdd0a86c7460cf539833233c64ae5c627ec709a..c020c29ac8c682b199deb3f2dc3cdb4399766a5d 100644 (file)
@@ -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);