Skip to content

Commit 766b479

Browse files
authored
update imgproxy-url-builder
1 parent 01337f1 commit 766b479

File tree

6 files changed

+26
-60
lines changed

6 files changed

+26
-60
lines changed

README.md

Lines changed: 7 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,12 @@ app.prepare().then(() => {
7272
After registering the endpoint you can use the `<ProxyImage />` component as you would with the `Image` component from `next/image`, except that you need to provide a file (`<bucketname>/<filename>`) instead of `src` and optional proxy params for image transformations/optimizations.
7373

7474
```tsx
75-
import ProxyImage, {
76-
ImgProxyParamBuilder,
77-
} from '@bitpatty/next-image-s3-imgproxy-loader';
75+
import ProxyImage from '@bitpatty/next-image-s3-imgproxy-loader';
76+
import pb from '@bitpatty/imgproxy-url-builder';
7877

7978
<ProxyImage
8079
file="mybucket/myfile.png"
81-
proxyParams={new ImgProxyParamBuilder().rotate(180).blur(10).build()}
80+
proxyParams={pb().rotate(180).blur(10).build()}
8281
/>;
8382
```
8483

@@ -90,9 +89,10 @@ In case using the component is not an option, you can instead use the image path
9089

9190
```tsx
9291
import { buildProxyImagePath } from '@bitpatty/next-image-s3-imgproxy-loader';
92+
import pb from '@bitpatty/imgproxy-url-builder';
9393

9494
const imagePath = buildProxyImagePath('test-bucket/test-image.png', {
95-
proxyParams: new ImgProxyParamBuilder().blur(10).build(),
95+
proxyParams: pb().blur(10).build(),
9696
});
9797

9898
<img src={imagePath} />;
@@ -102,9 +102,10 @@ or as background image
102102

103103
```tsx
104104
import { buildProxyImagePath } from '@bitpatty/next-image-s3-imgproxy-loader';
105+
import pb from '@bitpatty/imgproxy-url-builder';
105106

106107
const imagePath = buildProxyImagePath('test-bucket/test-image.png', {
107-
proxyParams: new ImgProxyParamBuilder().blur(10).format('jpg').build(),
108+
proxyParams: pb().blur(10).format('jpg').build(),
108109
});
109110

110111
<div
@@ -139,36 +140,3 @@ buildProxyImagePath('test-bucket/test-image.png', {
139140
endpoint: '/my-endpoint',
140141
});
141142
```
142-
143-
## Available Transformations
144-
145-
The following transformations have been implemented (Note that it is not planned to implement PRO transformations).
146-
147-
| Transformation | Supported |
148-
| --------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
149-
| [`Signature`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#signature) | :white_check_mark: |
150-
| [`Blur`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#blur) | :white_check_mark: |
151-
| [`Resize`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#resize) | :white_check_mark: |
152-
| [`Size`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#size) | :wavy_dash: (via Resize) |
153-
| [`Width`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#width) | :wavy_dash: (via Resize) |
154-
| [`Height`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#height) | :wavy_dash: (via Resize) |
155-
| [`Dpr`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#dpr) | :white_check_mark: |
156-
| [`Enlarge`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#enlarge) | :wavy_dash: (via Resize) |
157-
| [`Extend`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#extend) | :wavy_dash: (via Resize) |
158-
| [`Gravity`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#gravity) | :wavy_dash: (via Resize) |
159-
| [`Crop`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#crop) | :white_check_mark: |
160-
| [`Padding`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#padding) | :white_check_mark: |
161-
| [`Trim`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#trim) | :white_check_mark: |
162-
| [`Rotate`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#rotate) | :white_check_mark: |
163-
| [`Quality`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#quality) | :white_check_mark: |
164-
| [`Max Bytes`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#max-bytes) | :white_check_mark: |
165-
| [`Background`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#background) | :white_check_mark: |
166-
| [`Sharpen`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#sharpen) | :white_check_mark: |
167-
| [`Watermark`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#watermark) | :white_check_mark: |
168-
| [`Preset`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#preset) | :white_check_mark: |
169-
| [`Cache Buster`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#cache-buster) | :white_check_mark: |
170-
| [`Strip Metadata`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#strip-metadata) | :white_check_mark: |
171-
| [`Strip Color Profile`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#strip-color-profile) | :white_check_mark: |
172-
| [`Auto Rotate`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#auto-rotate) | :white_check_mark: |
173-
| [`Filename`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#filename) | :white_check_mark: |
174-
| [`Format`](https://github.com/imgproxy/imgproxy/blob/master/docs/generating_the_url_advanced.md#format) | :white_check_mark: |

example/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12-
"@bitpatty/imgproxy-url-builder": "^0.1.0",
12+
"@bitpatty/imgproxy-url-builder": "^0.2.0",
1313
"next": "11.1.2",
1414
"react": "^17.0.2",
1515
"react-dom": "17.0.2"

example/pages/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ const demoContent: {
8787
.resize({
8888
type: ResizeType.FILL,
8989
width: 100,
90-
height: 100,
91-
enlarge: true,
9290
})
9391
.build(),
9492
},

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bitpatty/next-image-s3-imgproxy-loader",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"description": "imgproxy S3 extension for next/image",
55
"author": "Matteias Collet <[email protected]>",
66
"main": "dist/index.js",
@@ -39,6 +39,6 @@
3939
"next": "^11.0.0"
4040
},
4141
"dependencies": {
42-
"@bitpatty/imgproxy-url-builder": "^0.1.0"
42+
"@bitpatty/imgproxy-url-builder": "^0.2.0"
4343
}
4444
}

0 commit comments

Comments
 (0)