debug import_profile_photo
This commit is contained in:
parent
32d07c3df7
commit
127f5a447d
@ -656,7 +656,9 @@ function import_profile_photo($photo,$xchan) {
|
|||||||
|
|
||||||
$a = get_app();
|
$a = get_app();
|
||||||
|
|
||||||
$r = q("select `resource_id` from photo where xchan = '%s' and `scale` = 4 limit 1",
|
logger('import_profile_photo: updating channel photo from ' . $photo . ' for ' . $xchan, LOGGER_DEBUG);
|
||||||
|
|
||||||
|
$r = q("select resource_id from photo where xchan = '%s' and scale = 4 limit 1",
|
||||||
dbesc($xchan)
|
dbesc($xchan)
|
||||||
);
|
);
|
||||||
if($r) {
|
if($r) {
|
||||||
@ -668,6 +670,7 @@ function import_profile_photo($photo,$xchan) {
|
|||||||
|
|
||||||
$photo_failure = false;
|
$photo_failure = false;
|
||||||
|
|
||||||
|
|
||||||
$filename = basename($photo);
|
$filename = basename($photo);
|
||||||
$img_str = fetch_url($photo,true);
|
$img_str = fetch_url($photo,true);
|
||||||
|
|
||||||
@ -700,9 +703,10 @@ function import_profile_photo($photo,$xchan) {
|
|||||||
$thumb = $a->get_baseurl() . '/photo/' . $hash . '-5';
|
$thumb = $a->get_baseurl() . '/photo/' . $hash . '-5';
|
||||||
$micro = $a->get_baseurl() . '/photo/' . $hash . '-6';
|
$micro = $a->get_baseurl() . '/photo/' . $hash . '-6';
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
|
logger('import_profile_photo: invalid image from ' . $photo);
|
||||||
$photo_failure = true;
|
$photo_failure = true;
|
||||||
|
}
|
||||||
if($photo_failure) {
|
if($photo_failure) {
|
||||||
$photo = $a->get_baseurl() . '/images/person-175.jpg';
|
$photo = $a->get_baseurl() . '/images/person-175.jpg';
|
||||||
$thumb = $a->get_baseurl() . '/images/person-80.jpg';
|
$thumb = $a->get_baseurl() . '/images/person-80.jpg';
|
||||||
|
Reference in New Issue
Block a user