Back

storage.getFilePreview() quality parameter for thumbnails

  • 0
  • Flutter
  • Storage
pitcairn1987
18 Sep, 2023, 12:36

Hi, I wonder which is better option for download thumbnails for my items list in Flutter app. For example when I set quality parameter to 10, Will request take longer than without quality parameter? Second option I'm considering is compress image in my app and always download in full quality.

TL;DR
Using the preview endpoint and adjusting the quality parameter can result in smaller file sizes and less network bandwidth, but it may take longer to process the file. Processing the file server-side is generally recommended to avoid potential lag on devices.
Drake
18 Sep, 2023, 16:47

which is better option for download thumbnails for my items list in Flutter app.

In general, I think it's good to use the preview endpoint.

For example when I set quality parameter to 10, Will request take longer than without quality parameter?

There's a tradeoff. changing the quality might take more time to process the file, but the file size could be smaller so network bandwidth could be less. Keep in mind, Appwrite caches files on the server too so the file processing would only be done once.

Second option I'm considering is compress image in my app and always download in full quality.

I prefer processing the file server-side because devices may not have enough resources to process the file without lagging the device.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more