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 ...@@ -61,10 +61,11 @@ To learn more about configuring the behavior of the built-in [Image Optimization
- [Gumlet](#gumlet) - [Gumlet](#gumlet)
- [ImageEngine](#imageengine) - [ImageEngine](#imageengine)
- [Imgix](#imgix) - [Imgix](#imgix)
- [Thumbor](#thumbor) - [PixelBin](#pixelbin)
- [Sanity](#sanity) - [Sanity](#sanity)
- [Sirv](#sirv) - [Sirv](#sirv)
- [Supabase](#supabase) - [Supabase](#supabase)
- [Thumbor](#thumbor)
### Akamai ### Akamai
...@@ -172,13 +173,16 @@ export default function imgixLoader({ src, width, quality }) { ...@@ -172,13 +173,16 @@ export default function imgixLoader({ src, width, quality }) {
} }
``` ```
### Thumbor ### PixelBin
```js ```js
// Docs: https://thumbor.readthedocs.io/en/latest/ // Doc (Resize): https://www.pixelbin.io/docs/transformations/basic/resize/#width-w
export default function thumborLoader({ src, width, quality }) { // Doc (Optimise): https://www.pixelbin.io/docs/optimizations/quality/#image-quality-when-delivering
const params = [`${width}x0`, `filters:quality(${quality || 75})`] // Doc (Auto Format Delivery): https://www.pixelbin.io/docs/optimizations/format/#automatic-format-selection-with-f_auto-url-parameter
return `https://example.com${params.join('/')}${src}` 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 }) { ...@@ -225,3 +229,13 @@ export default function supabaseLoader({ src, width, quality }) {
return url.href 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