mirror of
https://github.com/friendica/friendica
synced 2025-04-27 12:30:11 +00:00
Issue 6477: Use the correct content-type to resize the images
This commit is contained in:
parent
f0849b0a93
commit
14c28868eb
2 changed files with 10 additions and 8 deletions
|
@ -1737,17 +1737,14 @@ class Contact extends BaseObject
|
|||
$photos = Photo::importProfilePhoto($avatar, $uid, $cid, true);
|
||||
|
||||
if ($photos) {
|
||||
DBA::update(
|
||||
'contact',
|
||||
['avatar' => $avatar, 'photo' => $photos[0], 'thumb' => $photos[1], 'micro' => $photos[2], 'avatar-date' => DateTimeFormat::utcNow()],
|
||||
['id' => $cid]
|
||||
);
|
||||
$fields = ['avatar' => $avatar, 'photo' => $photos[0], 'thumb' => $photos[1], 'micro' => $photos[2], 'avatar-date' => DateTimeFormat::utcNow()];
|
||||
DBA::update('contact', $fields, ['id' => $cid]);
|
||||
|
||||
// Update the public contact (contact id = 0)
|
||||
if ($uid != 0) {
|
||||
$pcontact = DBA::selectFirst('contact', ['id'], ['nurl' => $contact['nurl'], 'uid' => 0]);
|
||||
if (DBA::isResult($pcontact)) {
|
||||
self::updateAvatar($avatar, 0, $pcontact['id'], $force);
|
||||
DBA::update('contact', $fields, ['id' => $pcontact['id']]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue