Skip to content

Commit c3382c0

Browse files
committed
Revert "Merge branch '@invertase/operations-basic-tests'"
This reverts commit a1fd3f3, reversing changes made to 9e3bf0e.
1 parent a5e8125 commit c3382c0

File tree

19 files changed

+57
-734
lines changed

19 files changed

+57
-734
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,3 @@ firebase-debug.*.log*
8383
.firebase/
8484
.DS_Store
8585
yarn.lock
86-
87-
88-
#vscode
89-
.vscode

docs/storage-image-processing-api/getting-started.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ This extension requires a `STORAGE_BUCKET`, this is the location where the proce
66

77
## Generating an image
88

9-
This extension allows multiple chaining of operations within the URL, allowing multiple transformations to be parsed and applied to the image to be processed.
9+
This extension allows multiple chaining of operations within the url, allowing multiple transformations to be parsed and applied to the image to be processed.
1010

11-
This URL can be broken down into the following parts.
11+
This url can be broken down into the following parts.
1212

1313
{`domain`}?{`input`}/{`operations`}/{`output`}
1414

@@ -38,7 +38,7 @@ A full list of options can be found (here)[/output]
3838

3939
## Understanding operations
4040

41-
As a URL can be broken down into the above sections. Each input, operation and output can contain multiple elements. This allows multiple transformation to be applied simultaneously.
41+
As urls can be broken down into the above sections. Each input, operation and output can contain multiple elements. This allows multiple transformation to be applied simultaneously.
4242

4343
### Parsing
4444

docs/storage-image-processing-api/input.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Example: /input~`type:url~create`
1212

1313
## Gsc
1414

15-
This is a valid google cloud storage URL of an existing image.
15+
This is a valid google cloud storage url of an existing image.
1616

17-
Example: input~`type:gcs~source`:example.png
17+
Example: input~`type:url~gsc`:exampleimage.com
1818

19-
## URL
19+
## Url
2020

21-
A generic URL of an existing image
21+
A generic url of an existing image
2222

2323
Example: /input~`type:url~url`:https://www.exampleimage.com

docs/storage-image-processing-api/operations/index.mdx

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ This will, in general, enhance the clarity of the image by bringing out darker d
6161
| ----- | :---: | :------: | :-------: | :-------: | :-----: |
6262
| sigma | Float | x | 0.3 | 1000 | n/a |
6363

64+
### `Colorspace`
65+
66+
Output colourspace e.g. srgb, rgb, cmyk, lab, b-w ...
67+
68+
#### **Options**
69+
70+
| Key | Type | Optional | Min Value | Max Value | Default |
71+
| ----- | :------------------------------------------------------------------: | :------: | :-------: | :-------: | :-----: |
72+
| width | Enum([Colorspace](/storage-image-processing-api/types/interpolator)) | x | n/a | n/a | n/a |
73+
6474
### `Composite`
6575

6676
Composite an image over the base image. The image to composite must be the same size
@@ -74,13 +84,13 @@ If both `top` and `left` options are provided, they take precedence over `gravit
7484
| Key | Type | Optional | Min Value | Max Value | Default |
7585
| ------------- | :----------------------------------------------------------: | :------: | :-------: | :-------: | :-----: |
7686
| input | string | x | n/a | n/a | n/a |
77-
| blend | Enum([Blend](/storage-image-processing-api/types/blend)) | | n/a | n/a | n/a |
87+
| blend | Enum([Blend](/storage-image-processing-api/types/blend)) | x | n/a | n/a | n/a |
7888
| gravity | Enum([Gravity](/storage-image-processing-api/types/gravity)) || n/a | n/a | n/a |
7989
| top | Integer || n/a | n/a | n/a |
8090
| left | Integer || n/a | n/a | n/a |
8191
| tile | Boolean || n/a | n/a | n/a |
82-
| premultiplied | string | | n/a | n/a | n/a |
83-
| density | Integer | | n/a | n/a | 72 |
92+
| premultiplied | string | x | n/a | n/a | n/a |
93+
| density | Integer | x | n/a | n/a | 72 |
8494

8595
### `Convolve`
8696

@@ -142,8 +152,8 @@ Zero-indexed offset in pixels from the top edge.
142152
| ------ | :-----: | :------: | :-------: | :-------: | :-----: |
143153
| top | Integer || n/a | n/a | 0 |
144154
| left | Integer || n/a | n/a | 0 |
145-
| width | Integer | x | n/a | n/a | 0 |
146-
| height | Integer | x | n/a | n/a | 0 |
155+
| bottom | Integer | | n/a | n/a | 0 |
156+
| right | Integer | | n/a | n/a | 0 |
147157

148158
### `Flatten`
149159

@@ -193,7 +203,7 @@ when applying a gamma correction.
193203

194204
| Key | Type | Optional | Min Value | Max Value | Default |
195205
| -------- | :----: | :------: | :-------: | :-------: | :-----: |
196-
| gamma | String | | 1.0 | 3.0 | 1.0 |
206+
| gamma | String | x | 1.0 | 3.0 | 1.0 |
197207
| gammaOut | String || 1.0 | 3.0 | n/a |
198208

199209
### `Grayscale`
@@ -226,7 +236,7 @@ Apply the linear formula a \* input + b to the image (levels adjustment)
226236

227237
| Key | Type | Optional | Min Value | Max Value | Default |
228238
| --- | :---: | :------: | :-------: | :-------: | :-----: |
229-
| a | Float || n/a | n/a | 1.0 |
239+
| a | Float || n/a | n/a | 0.0 |
230240
| b | Float || n/a | n/a | 0.0 |
231241

232242
### `Median`
@@ -241,9 +251,9 @@ e.g. a size of 15 on a 500x500 image adds around 1.5s to processing time.
241251

242252
#### **Options**
243253

244-
| Key | Type | Optional | Min Value | Max Value | Default |
245-
| ---- | :-----: | :------: | :-------: | :-------: | :-----: |
246-
| size | Integer || 1 | 1000 | 3 |
254+
| Key | Type | Optional | Min Value | Max Value | Default |
255+
| ---- | :---: | :------: | :-------: | :-------: | :-----: |
256+
| size | Float || 1 | 1000 | 3 |
247257

248258
### `Modulate`
249259

@@ -260,12 +270,9 @@ Transforms the image using brightness, saturation and hue rotation.
260270

261271
#### **Options**
262272

263-
| Key | Type | Optional | Min Value | Max Value | Default |
264-
| ---------- | :-----: | :------: | :-------: | :-------: | :-----: |
265-
| brightness | Integer || 1 | 1000 | 3 |
266-
| saturation | Integer || 1 | 1000 | 3 |
267-
| hue | Integer || 1 | 1000 | 3 |
268-
| lightness | Integer || 1 | 1000 | 3 |
273+
| Key | Type | Optional | Min Value | Max Value | Default |
274+
| ---- | :---: | :------: | :-------: | :-------: | :-----: |
275+
| size | Float || 1 | 1000 | 3 |
269276

270277
### `Negate`
271278

@@ -304,16 +311,12 @@ How the image should be resized to fit both provided dimensions.
304311

305312
#### **Options**
306313

307-
| Key | Type | Optional | Min Value | Max Value | Default |
308-
| ------------------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------: | :-------: | :-------: | :-----: |
309-
| width | Enum([operationResizeFit](/storage-image-processing-api/types/operationResizeFit)) || n/a | n/a | n/a |
310-
| height | Enum([operationResizeFit](/storage-image-processing-api/types/operationResizeFit)) || n/a | n/a | n/a |
311-
| fit | Enum([operationResizeFit](/storage-image-processing-api/types/operationResizeFit)) || n/a | n/a | n/a |
312-
| position | Enum([operationResizePosition](/storage-image-processing-api/types/operationResizePosition)) / Enum([operationResizeStrategy](/storage-image-processing-api/types/operationResizeStrategy)) / / Enum([imageGravity](/storage-image-processing-api/types/imageGravity)) || n/a | n/a | n/a |
313-
| kernel | Enum([operationResizeKernel](/storage-image-processing-api/types/operationResizeKernel)) || n/a | n/a | n/a |
314-
| background | String || n/a | n/a | n/a |
315-
| withoutEnlargement | Boolean || n/a | n/a | n/a |
316-
| fastShrinkOnLoad | Boolean || n/a | n/a | n/a |
314+
| Key | Type | Optional | Min Value | Max Value | Default |
315+
| ----------------------- | :------------------------------------------------------------------------------------------: | :------: | :-------: | :-------: | :-----: |
316+
| operationResizeFit | Enum([operationResizeFit](/storage-image-processing-api/types/operationResizeFit)) | x | n/a | n/a | n/a |
317+
| operationResizePosition | Enum([operationResizePosition](/storage-image-processing-api/types/operationResizePosition)) | x | n/a | n/a | n/a |
318+
| operationResizeKernel | Enum([operationResizeKernel](/storage-image-processing-api/types/operationResizeKernel)) | x | n/a | n/a | n/a |
319+
| operationResizeStrategy | Enum([operationResizeStrategy](/storage-image-processing-api/types/operationResizeStrategy)) | x | n/a | n/a | n/a |
317320

318321
### `Rotate`
319322

@@ -337,7 +340,7 @@ The use of rotate implies the removal of the EXIF Orientation tag, if any.
337340

338341
| Key | Type | Optional | Min Value | Max Value | Default |
339342
| ----- | :-----: | :------: | :-------: | :-------: | :-----: |
340-
| angle | Integer || n/a | n/a | auto |
343+
| angle | Integer || n/a | n/a | n/a |
341344

342345
### `Sharpen`
343346

@@ -359,14 +362,17 @@ Separate control over the level of sharpening in "flat" and "jagged" areas is av
359362

360363
### `Text`
361364

362-
A string of text that will be rendered over your image.
365+
Sharpen the image. When used without parameters, performs a fast, mild sharpen of the output image.
366+
367+
When a sigma is provided, performs a slower, more accurate sharpen of the L channel in the LAB colour space.
368+
369+
Separate control over the level of sharpening in "flat" and "jagged" areas is available.
363370

364371
#### **Options**
365372

366373
| Key | Type | Optional | Min Value | Max Value | Default |
367374
| --------------- | :--------------------------------------------------------------: | :------: | :-------: | :-------: | :-------------: |
368-
| value | String | x | n/a | n/a | 30px sans-serif |
369-
| font | String || n/a | n/a | 30px sans-serif |
375+
| font | String || 0.01 | 1000 | 30px sans-serif |
370376
| textAlign | Enum([textAlign](/storage-image-processing-api/types/textAlign)) || n/a | n/a | n/a |
371377
| textColor | Integer || n/a | n/a | white |
372378
| backgroundColor | String || n/a | n/a | n/a |
@@ -377,7 +383,7 @@ A string of text that will be rendered over your image.
377383
| borderColor | String || n/a | n/a | black |
378384
| wrap | Boolean || n/a | n/a | n/a |
379385
| maxWidth | Integer || n/a | n/a | n/a |
380-
| blend | Enum([Blend](/storage-image-processing-api/types/blend)) || n/a | n/a | over |
386+
| blend | Enum([Blend](/storage-image-processing-api/types/blend)) || n/a | n/a | 0 |
381387
| gravity | Enum([Gravity](/storage-image-processing-api/types/gravity)) || n/a | n/a | n/a |
382388
| top | Integer || n/a | n/a | n/a |
383389
| left | Integer || n/a | n/a | n/a |
@@ -417,7 +423,7 @@ An alpha channel if present will be unchanged by the operation.
417423

418424
| Key | Type | Optional | Min Value | Max Value | Default |
419425
| --------- | :-----: | :------: | :-------: | :-------: | :-----: |
420-
| threshold | Integer || 0 | n/a | 10 |
426+
| threshold | Integer || 0 | n/a | n/a |
421427

422428
export const EXTENSION_URL =
423429
'https://europe-central2-dev-extensions-testing.cloudfunctions.net/ext-storage-image-processing-api-ri3r-handler/process';

docs/storage-image-processing-api/output/index.mdx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,4 @@ This must be one of the following...
1616
- [avif](/storage-image-processing-api/output/avif)
1717
- [png](/storage-image-processing-api/output/png)
1818

19-
This can be added at the end of the process URL as `/output~format:png`.
20-
21-
## toColorspace`
22-
23-
Output colourspace e.g. srgb, rgb, cmyk, lab, b-w ...
24-
25-
#### **Options**
26-
27-
| Key | Type | Optional | Min Value | Max Value | Default |
28-
| ------------ | :----------------------------------------------------------------: | :------: | :-------: | :-------: | :-----: | --- |
29-
| toColorspace | Enum([Colorspace](/storage-image-processing-api/types/colorspace)) | x | n/a | n/a | n/a | ` |
19+
This can be added at the end of the process url as `/output~format:png`.

docs/storage-image-processing-api/types/colorspace.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ as alpha channels.
2020

2121
**srgb**
2222

23-
**Fourier**
23+
**fourier**
2424

2525
**rgb16**
2626

docs/storage-image-processing-api/types/gravity.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Enum of the gravity location.
66

77
**center**
88

9-
**center**
9+
**centre**
1010

1111
**north**
1212

docs/storage-image-processing-api/types/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This page contains an assorted list of types and enums that are used throughout
1616

1717
### [OperationResizeFit](/storage-image-processing-api/types/operationResizeFit)
1818

19-
### [OperationResizeKernel](/storage-image-processing-api/types/operationResizeKernel)
19+
### [OperationResizeKernal](/storage-image-processing-api/types/operationResizeKernal)
2020

2121
### [OperationResizePosition](/storage-image-processing-api/types/operationResizePosition)
2222

docs/storage-image-processing-api/types/operationResizeKernel.mdx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,12 @@
22

33
#### **Options**
44

5-
**Nearest**
5+
**nearest**
66

7-
Use nearest neighbour interpolation.
7+
**cubic**
88

9-
**Cubic**
9+
**mitchell**
1010

11-
Use a Catmull-Rom spline.
11+
**lanczos2**
1212

13-
**Mitchell**
14-
15-
Use a Mitchell-Netravali spline .
16-
17-
**Lanczos2**
18-
19-
Use a Lanczos kernel with a=2.
20-
21-
**Lanczos3**
22-
23-
Use a Lanczos kernel with a=3 (the default).
13+
**lanczos3**

0 commit comments

Comments
 (0)