Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5d77b34

Browse files
committedApr 3, 2025·
chore(image-processing-api): format
1 parent 014a439 commit 5d77b34

File tree

2 files changed

+14
-23
lines changed

2 files changed

+14
-23
lines changed
 

‎extensions/image-processing-api/PREINSTALL.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# Image Processing Extension
2+
23
Use this extension to optimize and transform images via a powerful HTTP API with over 30 image operations for enhancing and manipulating your images.
34

45
## How It Works
6+
57
When you install this extension, it deploys a Cloud Function that exposes an HTTP API. All requests must be sent to the /process endpoint of the function. You perform image operations by passing an operations query parameter—a URL-encoded JSON string defining the operations to execute.
68

79
### Example
10+
811
Define your operations like so:
912

1013
```js
@@ -73,6 +76,7 @@ const operations = [
7376
},
7477
];
7578
```
79+
7680
is equivalent to the earlier given example. The url `https://example.com/image.jpg` is constructed within the extension.
7781

7882
Note that this will **only** apply to paths that begin with a forward slash `/`, and **only** when the hostname parameter is set.

‎extensions/image-processing-api/README.md

+10-23
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
**Description**: Use this extension to optimize and transform images via a powerful HTTP API with over 30 different image operations to enhance and manipulate your images.
66

7-
8-
97
**Details**: # Image Processing Extension
108
Use this extension to optimize and transform images via a powerful HTTP API with over 30 image operations for enhancing and manipulating your images.
119

1210
## How It Works
11+
1312
When you install this extension, it deploys a Cloud Function that exposes an HTTP API. All requests must be sent to the /process endpoint of the function. You perform image operations by passing an operations query parameter—a URL-encoded JSON string defining the operations to execute.
1413

1514
### Example
15+
1616
Define your operations like so:
1717

1818
```js
@@ -81,6 +81,7 @@ const operations = [
8181
},
8282
];
8383
```
84+
8485
is equivalent to the earlier given example. The url `https://example.com/image.jpg` is constructed within the extension.
8586

8687
Note that this will **only** apply to paths that begin with a forward slash `/`, and **only** when the hostname parameter is set.
@@ -98,40 +99,26 @@ To install an extension, your project must be on the [Blaze (pay as you go) plan
9899
- Cloud Storage
99100
- Cloud Functions (Node.js 10+ runtime. [See FAQs](https://firebase.google.com/support/faq#extensions-pricing))
100101

101-
102-
103-
104102
**Configuration Parameters:**
105103

106-
* Cloud Functions location: Where do you want to deploy the functions created for this extension? You usually want a location close to your Storage bucket. For help selecting a location, refer to the [location selection guide](https://firebase.google.com/docs/functions/locations).
107-
108-
* Cloud Storage bucket for images: The Cloud Storage bucket where images that are to be processed are located. API requests with input urls or paths that are not inside this bucket will be dropped.
109-
110-
111-
* Allowed CORS origins: A comma delimited value of allowed CORS origins. Use the default of '*' to allow all origins. This is useful to lockdown your API and only allow your own website to embed the images directly. Note this will not prevent non-browser requests from accessing your API.
112-
113-
114-
* Hostname: An optional hostname to fetch images from. This can used to construct the original image URL in the response. Include ONLY the hostname, without any protocol or path. The protocol https:// will be added automatically. This parameter is needed if you would like to query using local path names such as /my/image.jpg. instead of the full URL.
104+
- Cloud Functions location: Where do you want to deploy the functions created for this extension? You usually want a location close to your Storage bucket. For help selecting a location, refer to the [location selection guide](https://firebase.google.com/docs/functions/locations).
115105

106+
- Cloud Storage bucket for images: The Cloud Storage bucket where images that are to be processed are located. API requests with input urls or paths that are not inside this bucket will be dropped.
116107

108+
- Allowed CORS origins: A comma delimited value of allowed CORS origins. Use the default of '\*' to allow all origins. This is useful to lockdown your API and only allow your own website to embed the images directly. Note this will not prevent non-browser requests from accessing your API.
117109

110+
- Hostname: An optional hostname to fetch images from. This can used to construct the original image URL in the response. Include ONLY the hostname, without any protocol or path. The protocol https:// will be added automatically. This parameter is needed if you would like to query using local path names such as /my/image.jpg. instead of the full URL.
118111

119112
**Cloud Functions:**
120113

121-
* **handler:** Serves a API accepting incoming HTTP requests.
122-
123-
114+
- **handler:** Serves a API accepting incoming HTTP requests.
124115

125116
**APIs Used**:
126117

127-
* storage-component.googleapis.com (Reason: Needed to use Cloud Storage)
128-
129-
118+
- storage-component.googleapis.com (Reason: Needed to use Cloud Storage)
130119

131120
**Access Required**:
132121

133-
134-
135122
This extension will operate with the following project IAM roles:
136123

137-
* storage.admin (Reason: Allows the extension to read images in Cloud Storage)
124+
- storage.admin (Reason: Allows the extension to read images in Cloud Storage)

0 commit comments

Comments
 (0)
Please sign in to comment.