X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2FPhoto.php;h=9934b9a3928f2e79ec060ede1cb55f547718f4ef;hb=1e967eddb75ebed6712e33735971d53b009442dd;hp=ca9ae0703c3162e1d0d853d4131b9b5a284fe0e7;hpb=d2e20d029ab603479400393ea4d6fb0e8be9a5eb;p=friendica.git diff --git a/include/Photo.php b/include/Photo.php index ca9ae0703c..9934b9a392 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -175,8 +175,7 @@ class Photo { - public function store($uid, $cid, $rid, $filename, $album, $scale, - $profile = 0, $allow_cid = '', $allow_gid = '', $deny_cid = '', $deny_gid = '') { + public function store($uid, $cid, $rid, $filename, $album, $scale, $profile = 0, $allow_cid = '', $allow_gid = '', $deny_cid = '', $deny_gid = '') { $r = q("INSERT INTO `photo` ( `uid`, `contact-id`, `resource-id`, `created`, `edited`, `filename`, `album`, `height`, `width`, `data`, `scale`, `profile`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid` ) @@ -188,9 +187,9 @@ class Photo { dbesc(datetime_convert()), dbesc(basename($filename)), dbesc($album), - intval($this->height), - intval($this->width), - dbesc($this->imageString()), + intval($this->height), + intval($this->width), + dbesc($this->imageString()), intval($scale), intval($profile), dbesc($allow_cid), @@ -235,8 +234,18 @@ function import_profile_photo($photo,$uid,$cid) { if($r === false) $photo_failure = true; + $img->scaleImage(48); + + $r = $img->store($uid, $cid, $hash, $filename, t('Contact Photos'), 6 ); + + if($r === false) + $photo_failure = true; + + + $photo = $a->get_baseurl() . '/photo/' . $hash . '-4.jpg'; $thumb = $a->get_baseurl() . '/photo/' . $hash . '-5.jpg'; + $micro = $a->get_baseurl() . '/photo/' . $hash . '-6.jpg'; } else $photo_failure = true; @@ -244,8 +253,9 @@ function import_profile_photo($photo,$uid,$cid) { if($photo_failure) { $photo = $a->get_baseurl() . '/images/default-profile.jpg'; $thumb = $a->get_baseurl() . '/images/default-profile-sm.jpg'; + $micro = $a->get_baseurl() . '/images/default-profile-mm.jpg'; } - return(array($photo,$thumb)); + return(array($photo,$thumb,$micro)); }