New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(storage-image-processing-api): initial extension build #2
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…image is mutated and the metadata will therefore change
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This allows us to use commas for list values, e.g. the arg value in `matrix:[[1,2,3,4,5],[1,2,3,4,5]]` could easily be extracted via a `JSON.parse(argValue)``
Includes support to create images without a base image, e.g., `http://localhost:3001/process/input~type:create~width:200~height:100/flatten~background:orange/text~value:Extensions/output~format:png`
Example of me mutating our Mutated:
|
Salakar
changed the title
[WIP] chore(storage-image-processing-api): initial extension build
chore(storage-image-processing-api): initial extension build
Jun 21, 2021
Salakar
force-pushed
the
storage-image-processing-api
branch
5 times, most recently
from
July 8, 2021 12:31
db6179f
to
2fd9479
Compare
Salakar
force-pushed
the
storage-image-processing-api
branch
from
July 8, 2021 12:46
2fd9479
to
2653f7b
Compare
Co-authored-by: Mike Diarmid <mike.diarmid@gmail.com>
…ertase/firebase-extensions into storage-image-processing-api
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introducing a Storage image processing extension which provides an extensive image processing API with 30+ image mutation operations from resizing and colour manipulation to overlaying text and compositing images.
The core image processing logic in the implementation is portable and therefore can be used in a variety of ways, e.g.,
but for this implementation, initially, interfacing with the image processing is provided as a URL safe HTTP GET API via a Cloud Function (and could be used for embedding e.g.,
<img src="<extensionFunctionUrl/process/...ops />
).Accessing GCS bucket objects is done via tokenated download urls, e.g.,
getDownloadUrl()
on Firebase SDKs or providing a path to a public object on the bucket, e.g.,/foo/bar.png
. URLs & paths must be URL encoded.Process Image URL Schema
The URL schema to apply operations is built into url parts separated by
/
, each segment is then in the following format;~
.'5'
as a string would become5
as a number, or'[1,2,3,4]'
as a string would result in a JS array of numbers.boolean
options can just specify the<optionName>
only to have the value default totrue
(think flags)./negate/
.input
operation must be the first operation specified and is required.output
operation must be the last operation specified and is required.Having the URL schema as url segments vs query parameters allows us to easily have operation ordering and support using multiple operations of the same type in a chain of operations. Additionally makes options clearer that they are for a specific operation.
Example
URL:
Output:
Supported operations
Operations pending implementation
Not blocked or difficult by any means, just needs time invested to implement. These will be added in a future PR.
TODO
composite
- currently sourcing from local files for testing purposes, should source from same sources that theinput
operation supports.output
operation format specific options, e.g., https://github.com/invertase/firebase-extensions/blob/storage-image-processing-api/extensions/storage-image-processing-api/functions/src/operations/output.ts#L32