Unverified Commit d6476dae authored by Abhay's avatar Abhay Committed by GitHub

chore(docs): Add example usage of PixelBin custom image loader (#64074)

### Improving Documentation
Integrate PixelBin Custom Image Loader for optimized image handling

PixelBin is Real-time image transformations with automatic optimization,
image URL and storage for efficient image organization

### References

- [Resize
Doc](https://www.pixelbin.io/docs/transformations/basic/resize/#width-w)
- [Optimize Doc](
https://www.pixelbin.io/docs/optimizations/quality/#image-quality-when-delivering)

### Contributors

- @pnutmath
- @umesh162
Co-authored-by: 's avatarSteven <steven@ceriously.com>
parent 9c83a345
......@@ -61,10 +61,11 @@ To learn more about configuring the behavior of the built-in [Image Optimization
- [Gumlet](#gumlet)
- [ImageEngine](#imageengine)
- [Imgix](#imgix)
- [Thumbor](#thumbor)
- [PixelBin](#pixelbin)
- [Sanity](#sanity)
- [Sirv](#sirv)
- [Supabase](#supabase)
- [Thumbor](#thumbor)
### Akamai
......@@ -172,13 +173,16 @@ export default function imgixLoader({ src, width, quality }) {
}
```
### Thumbor
### PixelBin
```js
// Docs: https://thumbor.readthedocs.io/en/latest/
export default function thumborLoader({ src, width, quality }) {
const params = [`${width}x0`, `filters:quality(${quality || 75})`]
return `https://example.com${params.join('/')}${src}`
// Doc (Resize): https://www.pixelbin.io/docs/transformations/basic/resize/#width-w
// Doc (Optimise): https://www.pixelbin.io/docs/optimizations/quality/#image-quality-when-delivering
// Doc (Auto Format Delivery): https://www.pixelbin.io/docs/optimizations/format/#automatic-format-selection-with-f_auto-url-parameter
export default function pixelBinLoader({ src, width, quality }) {
const name = '<your-cloud-name>'
const opt = `t.resize(w:${width})~t.compress(q:${quality || 75})`
return `https://cdn.pixelbin.io/v2/${name}/${opt}/${src}?f_auto=true`
}
```
......@@ -225,3 +229,13 @@ export default function supabaseLoader({ src, width, quality }) {
return url.href
}
```
### Thumbor
```js
// Docs: https://thumbor.readthedocs.io/en/latest/
export default function thumborLoader({ src, width, quality }) {
const params = [`${width}x0`, `filters:quality(${quality || 75})`]
return `https://example.com${params.join('/')}${src}`
}
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment