You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: extensions/image-processing-api/PREINSTALL.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,13 @@
1
1
# Image Processing Extension
2
+
2
3
Use this extension to optimize and transform images via a powerful HTTP API with over 30 image operations for enhancing and manipulating your images.
3
4
4
5
## How It Works
6
+
5
7
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.
6
8
7
9
### Example
10
+
8
11
Define your operations like so:
9
12
10
13
```js
@@ -73,6 +76,7 @@ const operations = [
73
76
},
74
77
];
75
78
```
79
+
76
80
is equivalent to the earlier given example. The url `https://example.com/image.jpg` is constructed within the extension.
77
81
78
82
Note that this will **only** apply to paths that begin with a forward slash `/`, and **only** when the hostname parameter is set.
Copy file name to clipboardExpand all lines: extensions/image-processing-api/README.md
+10-23
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,15 @@
4
4
5
5
**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.
6
6
7
-
8
-
9
7
**Details**: # Image Processing Extension
10
8
Use this extension to optimize and transform images via a powerful HTTP API with over 30 image operations for enhancing and manipulating your images.
11
9
12
10
## How It Works
11
+
13
12
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.
14
13
15
14
### Example
15
+
16
16
Define your operations like so:
17
17
18
18
```js
@@ -81,6 +81,7 @@ const operations = [
81
81
},
82
82
];
83
83
```
84
+
84
85
is equivalent to the earlier given example. The url `https://example.com/image.jpg` is constructed within the extension.
85
86
86
87
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
* 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).
115
105
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.
116
107
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.
117
109
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.
118
111
119
112
**Cloud Functions:**
120
113
121
-
***handler:** Serves a API accepting incoming HTTP requests.
122
-
123
-
114
+
-**handler:** Serves a API accepting incoming HTTP requests.
124
115
125
116
**APIs Used**:
126
117
127
-
* storage-component.googleapis.com (Reason: Needed to use Cloud Storage)
128
-
129
-
118
+
- storage-component.googleapis.com (Reason: Needed to use Cloud Storage)
130
119
131
120
**Access Required**:
132
121
133
-
134
-
135
122
This extension will operate with the following project IAM roles:
136
123
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