| Línea 1656... |
Línea 1656... |
| 1656 |
$source = $files['image']['tmp_name'];
|
1656 |
$source = $files['image']['tmp_name'];
|
| 1657 |
$target_filename = 'user-profile-' . uniqid() . '.png';
|
1657 |
$target_filename = 'user-profile-' . uniqid() . '.png';
|
| 1658 |
$crop_to_dimensions = true;
|
1658 |
$crop_to_dimensions = true;
|
| 1659 |
$unlink_source = false;
|
1659 |
$unlink_source = false;
|
| Línea 1660... |
Línea 1660... |
| 1660 |
|
1660 |
|
| 1661 |
if (!$image->uploadImageChangeSize($source, $target_path, $currentUser->uuid, $target_filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
|
1661 |
if (!$image->uploadProcessChangeSize($source, $target_path, $currentUser->uuid, $target_filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
|
| 1662 |
return new JsonModel([
|
1662 |
return new JsonModel([
|
| 1663 |
'success' => false,
|
1663 |
'success' => false,
|
| 1664 |
'data' => 'ERROR_THERE_WAS_AN_ERROR'
|
1664 |
'data' => 'ERROR_THERE_WAS_AN_ERROR'
|
| 1665 |
]);
|
1665 |
]);
|
| Línea 1676... |
Línea 1676... |
| 1676 |
if ($userProfile->public == UserProfile::PUBLIC_YES) {
|
1676 |
if ($userProfile->public == UserProfile::PUBLIC_YES) {
|
| Línea 1677... |
Línea 1677... |
| 1677 |
|
1677 |
|
| 1678 |
$target_filename = 'user-' . uniqid() . '.png';
|
1678 |
$target_filename = 'user-' . uniqid() . '.png';
|
| Línea 1679... |
Línea 1679... |
| 1679 |
$unlink_source = true;
|
1679 |
$unlink_source = true;
|
| 1680 |
|
1680 |
|
| 1681 |
if (!$image->uploadImageChangeSize($source, $target_path, $currentUser->uuid, $target_filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
|
1681 |
if (!$image->uploadProcessChangeSize($source, $target_path, $currentUser->uuid, $target_filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
|
| 1682 |
return new JsonModel([
|
1682 |
return new JsonModel([
|
| 1683 |
'success' => false,
|
1683 |
'success' => false,
|
| 1684 |
'data' => 'ERROR_THERE_WAS_AN_ERROR'
|
1684 |
'data' => 'ERROR_THERE_WAS_AN_ERROR'
|
| Línea 1819... |
Línea 1819... |
| 1819 |
$target_filename = 'user-cover-' . uniqid() . '.png';
|
1819 |
$target_filename = 'user-cover-' . uniqid() . '.png';
|
| 1820 |
$source = $files['cover']['tmp_name'];
|
1820 |
$source = $files['cover']['tmp_name'];
|
| 1821 |
$crop_to_dimensions = false;
|
1821 |
$crop_to_dimensions = false;
|
| 1822 |
$unlink_source = true;
|
1822 |
$unlink_source = true;
|
| Línea 1823... |
Línea 1823... |
| 1823 |
|
1823 |
|
| 1824 |
if (!$image->uploadImageChangeSize($source, $target_path, $currentUser->uuid, $target_filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
|
1824 |
if (!$image->uploadProcessChangeSize($source, $target_path, $currentUser->uuid, $target_filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
|
| 1825 |
return new JsonModel([
|
1825 |
return new JsonModel([
|
| 1826 |
'success' => false,
|
1826 |
'success' => false,
|
| 1827 |
'data' => 'ERROR_THERE_WAS_AN_ERROR'
|
1827 |
'data' => 'ERROR_THERE_WAS_AN_ERROR'
|
| 1828 |
]);
|
1828 |
]);
|