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:
Hypolite Petovan 2023-10-14 15:29:03 -04:00
parent e0d4646c18
commit 938b2bae23
5 changed files with 24 additions and 23 deletions

View file

@ -26,12 +26,12 @@ use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Model\Photo;
use Friendica\Module\Response;
use Friendica\Network\HTTPException\UnauthorizedException;
use Friendica\Util\Images;
use Friendica\Util\Profiler;
use Friendica\Util\Proxy;
use Friendica\Util\Strings;
use Psr\Log\LoggerInterface;
@ -109,8 +109,8 @@ class Browser extends BaseModule
[
"`resource-id` = ? AND `height` <= ? AND `width` <= ?",
$record['resource-id'],
640,
640
Proxy::PIXEL_MEDIUM,
Proxy::PIXEL_MEDIUM
],
['order' => ['scale']]);
$scale = $photo['scale'] ?? $record['loq'];