Skip to content

Commit 87b30e6

Browse files
authored
docs(storage-resize-images): fix typo in PREINSTALL (#2283)
1 parent 09fc5a0 commit 87b30e6

File tree

3 files changed

+32
-26
lines changed

3 files changed

+32
-26
lines changed

storage-resize-images/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
fixed - support '+' character in paths
44

5+
docs - fix typo in PREINSTALL.md
6+
57
## Version 0.2.7
68

79
fixed - maintain aspect ratio of resized images (#2115)

storage-resize-images/PREINSTALL.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,6 @@ The extension supports resizing images in `JPEG`, `PNG`, `WebP`, `GIF`, `AVIF` a
1616
The extension can publish a resize completion event, which you can optionally enable when you install the extension. If you enable events, you can write custom event handlers that respond to these events. You can always enable or disable events later. Events will be emitted via Eventarc.
1717

1818
Furthermore, you can choose if you want to receive events upon the successful completion of the image resizing. Hence, you can do anything based on the event you will receive. For example, you can use [EventArc gen2 functions](https://firebase.google.com/docs/functions/custom-events#handle-events) to be triggered on events published by the extension.
19-
### Example Event Handler for Successful Resize Operation
20-
```typescript
21-
import * as functions from 'firebase-functions';
22-
import { onCustomEventPublished } from 'firebase-functions/v2/eventarc';
23-
24-
export const onImageResized = onCustomEventPublished(
25-
"firebase.extensions.storage-resize-images.v1.onSuccess",
26-
(event) => {
27-
functions.logger.info("Resize Image is successful", event);
28-
// Additional operations based on the event data can be performed here
29-
return Promise.resolve();
30-
}
31-
);
3219

3320
#### Detailed configuration information
3421

@@ -50,6 +37,21 @@ You can install multiple instances of this extension for the same project to con
5037

5138
If events are enabled, and you want to create custom event handlers to respond to the events published by the extension, you must ensure that you have the appropriate [role/permissions](https://cloud.google.com/pubsub/docs/access-control#permissions_and_roles) to subscribe to Pub/Sub events.
5239

40+
#### Example Event Handler for Successful Resize Operation
41+
Here is a an example of a custom event handler for events you can choose to emit from this extension:
42+
```typescript
43+
import * as functions from 'firebase-functions';
44+
import { onCustomEventPublished } from 'firebase-functions/v2/eventarc';
45+
46+
export const onImageResized = onCustomEventPublished(
47+
"firebase.extensions.storage-resize-images.v1.onSuccess",
48+
(event) => {
49+
functions.logger.info("Resize Image is successful", event);
50+
// Additional operations based on the event data can be performed here
51+
return Promise.resolve();
52+
}
53+
);
54+
```
5355
#### Billing
5456
To install an extension, your project must be on the [Blaze (pay as you go) plan](https://firebase.google.com/pricing)
5557

storage-resize-images/README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,6 @@ The extension supports resizing images in `JPEG`, `PNG`, `WebP`, `GIF`, `AVIF` a
2424
The extension can publish a resize completion event, which you can optionally enable when you install the extension. If you enable events, you can write custom event handlers that respond to these events. You can always enable or disable events later. Events will be emitted via Eventarc.
2525

2626
Furthermore, you can choose if you want to receive events upon the successful completion of the image resizing. Hence, you can do anything based on the event you will receive. For example, you can use [EventArc gen2 functions](https://firebase.google.com/docs/functions/custom-events#handle-events) to be triggered on events published by the extension.
27-
### Example Event Handler for Successful Resize Operation
28-
```typescript
29-
import * as functions from 'firebase-functions';
30-
import { onCustomEventPublished } from 'firebase-functions/v2/eventarc';
31-
32-
export const onImageResized = onCustomEventPublished(
33-
"firebase.extensions.storage-resize-images.v1.onSuccess",
34-
(event) => {
35-
functions.logger.info("Resize Image is successful", event);
36-
// Additional operations based on the event data can be performed here
37-
return Promise.resolve();
38-
}
39-
);
4027

4128
#### Detailed configuration information
4229

@@ -58,6 +45,21 @@ You can install multiple instances of this extension for the same project to con
5845

5946
If events are enabled, and you want to create custom event handlers to respond to the events published by the extension, you must ensure that you have the appropriate [role/permissions](https://cloud.google.com/pubsub/docs/access-control#permissions_and_roles) to subscribe to Pub/Sub events.
6047

48+
#### Example Event Handler for Successful Resize Operation
49+
Here is a an example of a custom event handler for events you can choose to emit from this extension:
50+
```typescript
51+
import * as functions from 'firebase-functions';
52+
import { onCustomEventPublished } from 'firebase-functions/v2/eventarc';
53+
54+
export const onImageResized = onCustomEventPublished(
55+
"firebase.extensions.storage-resize-images.v1.onSuccess",
56+
(event) => {
57+
functions.logger.info("Resize Image is successful", event);
58+
// Additional operations based on the event data can be performed here
59+
return Promise.resolve();
60+
}
61+
);
62+
```
6163
#### Billing
6264
To install an extension, your project must be on the [Blaze (pay as you go) plan](https://firebase.google.com/pricing)
6365

0 commit comments

Comments
 (0)