mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 13:16:32 +02:00
Image handling reworked, new image formats added (#13900)
* Image handling reworked, new image formats added * Updated messages.po * The dot is now part of the file extension * Added WebP in install documentation * Handle unhandled mime types * Fixed animated picture detected
This commit is contained in:
parent
1ea8a4042d
commit
14e5b06029
31 changed files with 541 additions and 386 deletions
|
@ -132,8 +132,6 @@ function photos_post(App $a)
|
|||
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
|
||||
}
|
||||
|
||||
$phototypes = Images::supportedTypes();
|
||||
|
||||
$can_post = false;
|
||||
$visitor = 0;
|
||||
|
||||
|
@ -337,7 +335,7 @@ function photos_post(App $a)
|
|||
|
||||
if (DBA::isResult($photos)) {
|
||||
$photo = $photos[0];
|
||||
$ext = $phototypes[$photo['type']];
|
||||
$ext = Images::getExtensionByMimeType($photo['type']);
|
||||
Photo::update(
|
||||
['desc' => $desc, 'album' => $albname, 'allow_cid' => $str_contact_allow, 'allow_gid' => $str_circle_allow, 'deny_cid' => $str_contact_deny, 'deny_gid' => $str_circle_deny],
|
||||
['resource-id' => $resource_id, 'uid' => $page_owner_uid]
|
||||
|
@ -590,8 +588,6 @@ function photos_content(App $a)
|
|||
|
||||
$profile = Profile::getByUID($user['uid']);
|
||||
|
||||
$phototypes = Images::supportedTypes();
|
||||
|
||||
$_SESSION['photo_return'] = DI::args()->getCommand();
|
||||
|
||||
// Parse arguments
|
||||
|
@ -844,7 +840,7 @@ function photos_content(App $a)
|
|||
foreach ($r as $rr) {
|
||||
$twist = !$twist;
|
||||
|
||||
$ext = $phototypes[$rr['type']];
|
||||
$ext = Images::getExtensionByMimeType($rr['type']);
|
||||
|
||||
$imgalt_e = $rr['filename'];
|
||||
$desc_e = $rr['desc'];
|
||||
|
@ -855,7 +851,7 @@ function photos_content(App $a)
|
|||
'link' => 'photos/' . $user['nickname'] . '/image/' . $rr['resource-id']
|
||||
. ($order_field === 'created' ? '?order=created' : ''),
|
||||
'title' => DI::l10n()->t('View Photo'),
|
||||
'src' => 'photo/' . $rr['resource-id'] . '-' . $rr['scale'] . '.' . $ext,
|
||||
'src' => 'photo/' . $rr['resource-id'] . '-' . $rr['scale'] . $ext,
|
||||
'alt' => $imgalt_e,
|
||||
'desc' => $desc_e,
|
||||
'ext' => $ext,
|
||||
|
@ -1013,9 +1009,9 @@ function photos_content(App $a)
|
|||
}
|
||||
|
||||
$photo = [
|
||||
'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . '.' . $phototypes[$hires['type']],
|
||||
'href' => 'photo/' . $hires['resource-id'] . '-' . $hires['scale'] . Images::getExtensionByMimeType($hires['type']),
|
||||
'title' => DI::l10n()->t('View Full Size'),
|
||||
'src' => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . '.' . $phototypes[$lores['type']] . '?_u=' . DateTimeFormat::utcNow('ymdhis'),
|
||||
'src' => 'photo/' . $lores['resource-id'] . '-' . $lores['scale'] . Images::getExtensionByMimeType($lores['type']) . '?_u=' . DateTimeFormat::utcNow('ymdhis'),
|
||||
'height' => $hires['height'],
|
||||
'width' => $hires['width'],
|
||||
'album' => $hires['album'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue