mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-30 19:52:17 +01:00
Don't try to load a profile picture for contacts the doesn't have any.
This commit is contained in:
parent
1cf89738e2
commit
2b7cee1411
@ -56,25 +56,26 @@ $thumbnail_size = 23;
|
|||||||
// Find the photo from VCard.
|
// Find the photo from VCard.
|
||||||
$image = new OC_Image();
|
$image = new OC_Image();
|
||||||
$photo = $contact->getAsString('PHOTO');
|
$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->loadFromBase64($photo)) {
|
if($image->resize($thumbnail_size)) {
|
||||||
if($image->centerCrop()) {
|
if($image->show()) {
|
||||||
if($image->resize($thumbnail_size)) {
|
// done
|
||||||
if($image->show()) {
|
exit();
|
||||||
// done
|
} else {
|
||||||
exit();
|
OC_Log::write('contacts','thumbnail.php. Couldn\'t display thumbnail for ID '.$id,OC_Log::ERROR);
|
||||||
|
}
|
||||||
} 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 resize thumbnail for ID '.$id,OC_Log::ERROR);
|
||||||
}
|
}
|
||||||
} else {
|
}else{
|
||||||
OC_Log::write('contacts','thumbnail.php. Couldn\'t resize thumbnail for ID '.$id,OC_Log::ERROR);
|
OC_Log::write('contacts','thumbnail.php. Couldn\'t crop thumbnail for ID '.$id,OC_Log::ERROR);
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
OC_Log::write('contacts','thumbnail.php. Couldn\'t crop thumbnail for ID '.$id,OC_Log::ERROR);
|
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();
|
getStandardImage();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user