Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/contacts/thumbnail.php')
-rw-r--r--apps/contacts/thumbnail.php32
1 files changed, 17 insertions, 15 deletions
diff --git a/apps/contacts/thumbnail.php b/apps/contacts/thumbnail.php
index c020c29ac8c..5082626499b 100644
--- a/apps/contacts/thumbnail.php
+++ b/apps/contacts/thumbnail.php
@@ -48,6 +48,7 @@ if(is_null($contact)){
getStandardImage();
exit();
}
+OC_Response::enableCaching();
OC_Contacts_App::setLastModifiedHeader($contact);
$thumbnail_size = 23;
@@ -55,25 +56,26 @@ $thumbnail_size = 23;
// Find the photo from VCard.
$image = new OC_Image();
$photo = $contact->getAsString('PHOTO');
+if($photo) {
+ OC_Response::setETagHeader(md5($photo));
-OC_Response::setETagHeader(md5($photo));
-
-if($image->loadFromBase64($photo)) {
- if($image->centerCrop()) {
- if($image->resize($thumbnail_size)) {
- if($image->show()) {
- // done
- exit();
+ 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);
+ }
} 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 resize thumbnail for ID '.$id,OC_Log::ERROR);
}
- } else {
- OC_Log::write('contacts','thumbnail.php. Couldn\'t resize thumbnail for ID '.$id,OC_Log::ERROR);
+ }else{
+ OC_Log::write('contacts','thumbnail.php. Couldn\'t crop thumbnail for ID '.$id,OC_Log::ERROR);
}
- }else{
- OC_Log::write('contacts','thumbnail.php. Couldn\'t crop thumbnail for ID '.$id,OC_Log::ERROR);
+ } else {
+ OC_Log::write('contacts','thumbnail.php. Couldn\'t load image string for ID '.$id,OC_Log::ERROR);
}
-} else {
- OC_Log::write('contacts','thumbnail.php. Couldn\'t load image string for ID '.$id,OC_Log::ERROR);
}
getStandardImage();