Skip to content
Snippets Groups Projects
Commit 5c816c0c authored by Bart Visscher's avatar Bart Visscher
Browse files

Contacts: Optimize thumbnail cache handling a bit

parent 125cf79a
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,7 @@ if( is_null($contact)){ ...@@ -48,6 +48,7 @@ if( is_null($contact)){
getStandardImage(); getStandardImage();
exit(); exit();
} }
OC_Contacts_App::setLastModifiedHeader($contact);
$thumbnail_size = 23; $thumbnail_size = 23;
...@@ -56,12 +57,12 @@ $image = new OC_Image(); ...@@ -56,12 +57,12 @@ $image = new OC_Image();
$photo = $contact->getAsString('PHOTO'); $photo = $contact->getAsString('PHOTO');
OC_Response::setETagHeader(md5($photo)); OC_Response::setETagHeader(md5($photo));
OC_Contacts_App::setLastModifiedHeader($contact);
if($image->loadFromBase64($photo)) { if($image->loadFromBase64($photo)) {
if($image->centerCrop()) { if($image->centerCrop()) {
if($image->resize($thumbnail_size)) { if($image->resize($thumbnail_size)) {
if($image->show()) { if($image->show()) {
// done
exit(); exit();
} else { } else {
OC_Log::write('contacts','thumbnail.php. Couldn\'t display thumbnail for ID '.$id,OC_Log::ERROR); OC_Log::write('contacts','thumbnail.php. Couldn\'t display thumbnail for ID '.$id,OC_Log::ERROR);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment