mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 12:34:39 +02:00
Align proxy sizes to photo preview sizes
- PIXEL_SMALL goes from 300 to 320 - PIXEL_MEDIUM goes from 600 to 640 - Use Proxy pixel constants where we used hard-coded pixel values
This commit is contained in:
parent
e0d4646c18
commit
938b2bae23
5 changed files with 24 additions and 23 deletions
|
@ -312,16 +312,16 @@ function photos_post(App $a)
|
|||
|
||||
Photo::update(['height' => $height, 'width' => $width], ['resource-id' => $resource_id, 'uid' => $page_owner_uid, 'scale' => 0], $image);
|
||||
|
||||
if ($width > 640 || $height > 640) {
|
||||
$image->scaleDown(640);
|
||||
if ($width > \Friendica\Util\Proxy::PIXEL_MEDIUM || $height > \Friendica\Util\Proxy::PIXEL_MEDIUM) {
|
||||
$image->scaleDown(\Friendica\Util\Proxy::PIXEL_MEDIUM);
|
||||
$width = $image->getWidth();
|
||||
$height = $image->getHeight();
|
||||
|
||||
Photo::update(['height' => $height, 'width' => $width], ['resource-id' => $resource_id, 'uid' => $page_owner_uid, 'scale' => 1], $image);
|
||||
}
|
||||
|
||||
if ($width > 320 || $height > 320) {
|
||||
$image->scaleDown(320);
|
||||
if ($width > \Friendica\Util\Proxy::PIXEL_SMALL || $height > \Friendica\Util\Proxy::PIXEL_SMALL) {
|
||||
$image->scaleDown(\Friendica\Util\Proxy::PIXEL_SMALL);
|
||||
$width = $image->getWidth();
|
||||
$height = $image->getHeight();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue