From 127f5a447def2abc26c3beb62446fcabd5c11d0f Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 10 Feb 2013 20:09:32 -0800 Subject: debug import_profile_photo --- include/Photo.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include/Photo.php') diff --git a/include/Photo.php b/include/Photo.php index 3eccbb5fb..3ce531c44 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -656,7 +656,9 @@ function import_profile_photo($photo,$xchan) { $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) ); if($r) { @@ -668,6 +670,7 @@ function import_profile_photo($photo,$xchan) { $photo_failure = false; + $filename = basename($photo); $img_str = fetch_url($photo,true); @@ -700,9 +703,10 @@ function import_profile_photo($photo,$xchan) { $thumb = $a->get_baseurl() . '/photo/' . $hash . '-5'; $micro = $a->get_baseurl() . '/photo/' . $hash . '-6'; } - else + else { + logger('import_profile_photo: invalid image from ' . $photo); $photo_failure = true; - + } if($photo_failure) { $photo = $a->get_baseurl() . '/images/person-175.jpg'; $thumb = $a->get_baseurl() . '/images/person-80.jpg'; -- cgit v1.2.3