@@ -32,80 +32,9 @@ No extra configuration needed, the modifiers will be applied based on the url.
3232
3333This is made by [ ipx] ( https://github.com/unjs/ipx )
3434
35- ## 🖐 Installation
36-
37-
38- ** Add plugin dependency**
39- ``` bash
40- yarn add strapi-plugin-local-image-sharp
41- ```
42-
43- ## 🚚 Usage
44-
45- ### Examples
46-
47- This plugin works by setting modifiers either the path, or in the query string parameters.
48-
49- Get original image:
50-
51- ` http://localhost:1337/uploads/buffalo.png `
52-
53- #### Using path modifiers
54-
55- Change format to ` webp ` and keep other things same as source:
56-
57- ` http://localhost:1337/uploads/f_webp/buffalo_56442f4096.png `
58-
59- Keep original format ` png ` and set width to ` 200 ` :
60-
61- ` http://localhost:1337/uploads/w_200/buffalo_56442f4096.png `
62-
63- You can combine modifiers using a coma, for example:
64- Resize to ` 200x200px ` using ` embed ` method and change format to ` webp ` :
65-
66- ` http://localhost:1337/uploads/embed,f_webp,s_200x200/buffalo_56442f4096.png `
67-
68- #### Using query parameters modifiers
69-
70- Change format to ` webp ` and keep other things same as source:
71-
72- ` http://localhost:1337/uploads/buffalo_56442f4096.png?format=webp `
73-
74- Keep original format ` png ` and set width to ` 200 ` :
75-
76- ` http://localhost:1337/uploads/buffalo_56442f4096.png?width=200 `
77-
78- You can combine modifiers using a coma, for example:
79- Resize to ` 200x200px ` using ` embed ` method and change format to ` webp ` :
80-
81- ` http://localhost:1337/uploads/buffalo_56442f4096.png?format=webp&resize=200x200&embed `
82-
83- ### Modifiers
84-
85- | Property | Docs | Example | Comments |
86- | --------------- | :-------------------------------------------------------------- | :---------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
87- | width / w | [ Docs] ( https://sharp.pixelplumbing.com/api-resize#resize ) | ` http://localhost:1337/uploads/width_200/buffalo.png ` |
88- | height / h | [ Docs] ( https://sharp.pixelplumbing.com/api-resize#resize ) | ` http://localhost:1337/uploads/height_200/buffalo.png ` |
89- | resize / s | [ Docs] ( https://sharp.pixelplumbing.com/api-resize#resize ) | ` http://localhost:1337/uploads/s_200x200/buffalo.png ` |
90- | fit | [ Docs] ( https://sharp.pixelplumbing.com/api-resize#resize ) | ` http://localhost:1337/uploads/s_200x200,fit_outside/buffalo.png ` | Sets ` fit ` option for ` resize ` .
91- | position / pos | [ Docs] ( https://sharp.pixelplumbing.com/api-resize#resize ) | ` http://localhost:1337/uploads/s_200x200,pos_top/buffalo.png ` | Sets ` position ` option for ` resize ` .
92- | trim | [ Docs] ( https://sharp.pixelplumbing.com/api-resize#trim ) | ` http://localhost:1337/uploads/trim_100/buffalo.png ` |
93- | format | [ Docs] ( https://sharp.pixelplumbing.com/api-output#toformat ) | ` http://localhost:1337/uploads/format_webp/buffalo.png ` | Supported format: ` jpg ` , ` jpeg ` , ` png ` , ` webp ` , ` avif ` , ` gif ` , ` heif ` |
94- | quality / q | \_ | ` http://localhost:1337/uploads/quality_50/buffalo.png ` | Accepted values: 0 to 100 |
95- | rotate | [ Docs] ( https://sharp.pixelplumbing.com/api-operation#rotate ) | ` http://localhost:1337/uploads/rotate_45/buffalo.png ` |
96- | enlarge | \_ | ` http://localhost:1337/uploads/enlarge,s_2000x2000/buffalo.png ` | Allow the image to be upscaled. By default the returned image will never be larger than the source in any dimension, while preserving the requested aspect ratio. |
97- | flip | [ Docs] ( https://sharp.pixelplumbing.com/api-operation#flip ) | ` http://localhost:1337/uploads/flip/buffalo.png ` |
98- | flop | [ Docs] ( https://sharp.pixelplumbing.com/api-operation#flop ) | ` http://localhost:1337/uploads/flop/buffalo.png ` |
99- | sharpen | [ Docs] ( https://sharp.pixelplumbing.com/api-operation#sharpen ) | ` http://localhost:1337/uploads/sharpen_30/buffalo.png ` |
100- | median | [ Docs] ( https://sharp.pixelplumbing.com/api-operation#median ) | ` http://localhost:1337/uploads/median_10/buffalo.png ` |
101- | gamma | [ Docs] ( https://sharp.pixelplumbing.com/api-operation#gamma ) | ` http://localhost:1337/uploads/gamma_3/buffalo.png ` |
102- | negate | [ Docs] ( https://sharp.pixelplumbing.com/api-operation#negate ) | ` http://localhost:1337/uploads/negate/buffalo.png ` |
103- | normalize | [ Docs] ( https://sharp.pixelplumbing.com/api-operation#normalize ) | ` http://localhost:1337/uploads/normalize/buffalo.png ` |
104- | threshold | [ Docs] ( https://sharp.pixelplumbing.com/api-operation#threshold ) | ` http://localhost:1337/uploads/threshold_10/buffalo.png ` |
105- | tint | [ Docs] ( https://sharp.pixelplumbing.com/api-colour#tint ) | ` http://localhost:1337/uploads/tint_1098123/buffalo.png ` |
106- | grayscale | [ Docs] ( https://sharp.pixelplumbing.com/api-colour#grayscale ) | ` http://localhost:1337/uploads/grayscale/buffalo.png ` |
107- | animated | - | ` http://localhost:1337/uploads/animated/buffalo.gif ` | Experimental |
35+ ## 🚚 Getting Started
10836
37+ [ Read the Docs to Learn More.] ( https://strapi-community.github.io/strapi-plugin-local-image-sharp/ )
10938
11039## Contributing
11140
0 commit comments