Back

Image Preview parameters doing nothing

  • 1
  • Web
  • Storage
Meli
19 Dec, 2023, 14:21

Trying to fetch an image with a certain width and quality but the URL returned is the original image:

const response= storage.getFileView('car-image', '2PAATemwjcRf26aIfi-OUcedl', 300, 0, 'center', '10');

Also trying to manyally add the parameters in the URL does nothing:

https://cloud.appwrite.io/v1/storage/buckets/car-image/files/2PAATemwjcRf26aIfi-OUcedl/view?project=autokat&mode=admin&width=200

TL;DR
The user is having trouble with the image preview parameters not working in the Appwrite web SDK. The issue seems to be specific to .webp images. The parameters work when using 'preview' instead of 'view', but the image remains unchanged. Manually adding the parameters to the URL also does not have any effect. There is no solution provided in the support thread.
Meli
19 Dec, 2023, 14:24

Also using preview instead of view, the parameters work but the image is always this:

Meli
19 Dec, 2023, 14:28

Seems the issue is only with .webp images

Drake
19 Dec, 2023, 18:07

This is using the web sdk?

Drake
19 Dec, 2023, 18:08

The view API doesn't support those additional params you're passing: https://appwrite.io/docs/references/cloud/client-web/storage#getFileView

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