$Image->scaleDown(300);
}
+ $condition = ['resource-id' => $resource_id, 'uid' => local_user(), 'contact-id' => 0];
+
$r = Photo::store(
$Image,
local_user(),
if ($r === false) {
notice(DI::l10n()->t('Image size reduction [%s] failed.', '300'));
} else {
- Photo::update(['profile' => true], ['id' => $r['id']]);
+ Photo::update(['profile' => true], array_merge($condition, ['scale' => 4]));
}
$Image->scaleDown(80);
if ($r === false) {
notice(DI::l10n()->t('Image size reduction [%s] failed.', '80'));
} else {
- Photo::update(['profile' => true], ['id' => $r['id']]);
+ Photo::update(['profile' => true], array_merge($condition, ['scale' => 5]));
}
$Image->scaleDown(48);
if ($r === false) {
notice(DI::l10n()->t('Image size reduction [%s] failed.', '48'));
} else {
- Photo::update(['profile' => true], ['id' => $r['id']]);
+ Photo::update(['profile' => true], array_merge($condition, ['scale' => 6]));
}
Contact::updateSelfFromUserID(local_user(), true);