Back

Images compression and Its URLs

  • 1
  • Self Hosted
  • Storage
Nour
21 Dec, 2023, 11:57

I noticed that Appwrite has a built-in compression algorithm for files. However, when I created a new file after creating the bucket and enabled the Zstd algorithm for compression, it did not change the file size. Is there a configuration I forgot to set? When does the compression start? My second question is: there is a URL for the file in the bucket so, is there a way to get this URL from the SDK? Because the get_file method did not send this attribute.

TL;DR
The user is asking about the compression algorithm and its support for specific extensions or MIME types. They also mention that compression happens on file upload and ask about when the compression starts. They mention that they enabled the compression algorithm for a file but it did not change the file size, and ask if there is a configuration they forgot to set. They also ask about getting the URL for a file in the bucket from the SDK, as the get_file method did not provide this attribute. They inquire about setting the compression level and ask if there are any options for it. They mention the file sizes before and after compression and note that the compressed files'
Kenny
21 Dec, 2023, 13:58

Not sure about the compression, but for the url, you can dynamically build that pretty easily.

https://cloud.appwrite.io/v1/storage/buckets/AW_PROJECT_BUCKET_ID/files/IMAGE_ID/view?project=AW_PROJECT_ID

Drake
21 Dec, 2023, 18:08

did you upload the file before or after making the compression algorithm change?

Nour
24 Dec, 2023, 10:53

After....

Nour
24 Dec, 2023, 10:54

My file's size on my desktop

Nour
24 Dec, 2023, 10:55

The file's size on the storage

Nour
24 Dec, 2023, 10:55
Nour
24 Dec, 2023, 10:57

So, I understand that the compression starts immediately After I upload the file

Nour
26 Dec, 2023, 12:31

??

Drake
26 Dec, 2023, 23:56

Compression happens on file upload

Nour
27 Dec, 2023, 12:12

Does the compression algorithm support specific extensions or all MIME types?

Nour
31 Dec, 2023, 06:18

Hmmm, No I haven't

Nour
31 Dec, 2023, 06:20

I am going to try it locally

Nour
31 Dec, 2023, 08:20
Nour
31 Dec, 2023, 08:29
Drake
1 Jan, 2024, 23:14

So the size here is the original size, not the compressed size

Drake
1 Jan, 2024, 23:15

Can you look in the database, or the file on disk?

Drake
1 Jan, 2024, 23:15
Nour
2 Jan, 2024, 06:32

Is there a specific path where the storage's files saved in on the desk?

ideclon
2 Jan, 2024, 13:21

I believe the files are in the appwrite_appwrite-uploads docker volume

darkmess
4 Jan, 2024, 04:57

I wanted to try this out and the compressed files size on disk is even larger than before uploading?

darkmess
4 Jan, 2024, 05:05

Disregard my last comment as I had encryption enabled for the bucket. But now with encryption disabled the files are still the same size (disk and console)

darkmess
4 Jan, 2024, 05:06

the original uploaded files are 2,1MB and 491KB so the compression doesn't seem to do much

Drake
4 Jan, 2024, 16:06

ya maybe the compression settings...

Drake
4 Jan, 2024, 16:10

can you set the compression level? what are your options?

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