aboutsummaryrefslogtreecommitdiffstats
path: root/apps/contacts/thumbnail.php
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-02-14 01:11:21 +0100
committerThomas Tanghus <thomas@tanghus.net>2012-02-14 01:11:21 +0100
commit4446854f758b96f717ffb0f8a20e05356b5b93c5 (patch)
tree7266af49ed78b5610e6ce60d6109c8e1e9eb2d5a /apps/contacts/thumbnail.php
parent07c422d81d51b476717c5e0178ddbab073466e38 (diff)
downloadnextcloud-server-4446854f758b96f717ffb0f8a20e05356b5b93c5.tar.gz
nextcloud-server-4446854f758b96f717ffb0f8a20e05356b5b93c5.zip
Don't try to load a profile picture for contacts the doesn't have any.
Diffstat (limited to 'apps/contacts/thumbnail.php')
-rw-r--r--apps/contacts/thumbnail.php31
1 files changed, 16 insertions, 15 deletions
diff --git a/apps/contacts/thumbnail.php b/apps/contacts/thumbnail.php
index 39da6bc2bf7..5082626499b 100644
--- a/apps/contacts/thumbnail.php
+++ b/apps/contacts/thumbnail.php
@@ -56,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();