docs icon indicating copy to clipboard operation
docs copied to clipboard

Image transformation quality doesn't seem to default to 100

Open Cryszon opened this issue 9 months ago • 1 comments

As far as I can tell, omitting quality parameter doesn't actually default to 100, but whatever's default for sharp (e.g. 80 for WebP and JPEG or 50 for AVIF).

Here's how it's mentioned in the docs:

https://github.com/directus/docs/blob/399be27b6470802d9367471709bea80ef7b93e39/content/guides/5.files/4.transform.md?plain=1#L18

And here's where I think the transformation quality is set: https://github.com/directus/directus/blob/9fed080c8a5c7feb626f564ab158504481c07018/api/src/utils/transformations.ts#L14

Omitted value being undefined probably defaults to whatever sharp uses. Either the docs should mention the correct behaviour (maybe with a link to sharp docs) or the Directus code changed to a consistent number.

Cryszon avatar Mar 26 '25 18:03 Cryszon