mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 23:35:26 +00:00
Direct file upload on image service (#264)
This commit is contained in:
@@ -13,6 +13,8 @@ service Image {
|
||||
|
||||
// Upload an image by either sending a base64 encoded image to this endpoint or a URL.
|
||||
// To resize an image before uploading, see the Resize endpoint.
|
||||
// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json
|
||||
// with each parameter as a form field.
|
||||
message UploadRequest {
|
||||
// Base64 encoded image to upload,
|
||||
string base64 = 1;
|
||||
@@ -20,6 +22,8 @@ message UploadRequest {
|
||||
string url = 2;
|
||||
// Output name of the image including extension, ie. "cat.png"
|
||||
string name = 3;
|
||||
// The image file to upload
|
||||
bytes file = 4;
|
||||
}
|
||||
|
||||
message UploadResponse {
|
||||
@@ -51,6 +55,8 @@ message CropOptions {
|
||||
// Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters.
|
||||
// If one of width or height is 0, the image aspect ratio is preserved.
|
||||
// Optional cropping.
|
||||
// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json
|
||||
// with each parameter as a form field.
|
||||
message ResizeRequest {
|
||||
// base64 encoded image to resize,
|
||||
string base64 = 1;
|
||||
@@ -66,6 +72,8 @@ message ResizeRequest {
|
||||
// if provided, after resize, the image
|
||||
// will be cropped
|
||||
CropOptions cropOptions = 7;
|
||||
// The image file to resize
|
||||
bytes file = 8;
|
||||
}
|
||||
|
||||
message ResizeResponse {
|
||||
@@ -75,6 +83,8 @@ message ResizeResponse {
|
||||
|
||||
// Convert an image from one format (jpeg, png etc.) to an other either on the fly (from base64 to base64),
|
||||
// or by uploading the conversion result.
|
||||
// To use the file parameter you need to send the request as a multipart/form-data rather than the usual application/json
|
||||
// with each parameter as a form field.
|
||||
message ConvertRequest {
|
||||
// base64 encoded image to resize,
|
||||
string base64 = 1;
|
||||
@@ -84,6 +94,8 @@ message ConvertRequest {
|
||||
string name = 3;
|
||||
// make output a URL and not a base64 response
|
||||
bool outputURL = 4;
|
||||
// The image file to convert
|
||||
bytes file = 5;
|
||||
}
|
||||
|
||||
message ConvertResponse {
|
||||
|
||||
Reference in New Issue
Block a user