Skip to content

Conversation

hmacr
Copy link
Contributor

@hmacr hmacr commented Jul 21, 2025

What does this PR do?

  • Uses file-preview API to load webp images shown in the site cards.

Test Plan

  • Verified images load successfully
  • Massive reduction in image size from ~170kb(png) to ~25kb(webp).

Related PRs and Issues

Blocked by appwrite/appwrite#10181

.storage.getFilePreview(
'screenshots',
fileId,
undefined,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd have been great if this method accepted an object

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its in our backlog :(

return sdk.forConsoleIn(page.params.region).storage.getFileView('screenshots', fileId);
return sdk
.forConsoleIn(page.params.region)
.storage.getFilePreview(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also set resolutions for image, something reasonable. See what size image has on big screen, and double that (for retina displays). such size should be enough to have all details.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have macos with retina, double-check if it looks blurry or detailed. You can also ask me if you want to double check. If it looks blurry, let's stay at source resolution - not override it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't worry too much about the resolutions. a fixed, all in one, should be fine if we use a correct image format type. I expect previews should be cached as well. a mid range resolution should be just fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the resolution to 1024 x 576 (looks good, imo).

@ItzNotABug
Copy link
Member

Marking this as draft since the backend PR is WIP. cc @Meldiron

@ItzNotABug ItzNotABug marked this pull request as draft July 23, 2025 05:19
@hmacr
Copy link
Contributor Author

hmacr commented Jul 24, 2025

@ItzNotABug backend PR has been merged. Could you please review this PR?

@hmacr hmacr marked this pull request as ready for review July 24, 2025 15:09
@hmacr hmacr requested review from ItzNotABug and Meldiron July 24, 2025 15:09
@Meldiron Meldiron merged commit 5aa9f31 into appwrite:main Jul 25, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants