Skip to content
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

Add a resize functionality for interceptor #254

Open
ianjasperlean opened this issue Sep 21, 2020 · 0 comments
Open

Add a resize functionality for interceptor #254

ianjasperlean opened this issue Sep 21, 2020 · 0 comments

Comments

@ianjasperlean
Copy link

If you want to resize the file before the upload, you can pass on the resize property as follows:
@post('upload')
@UseInterceptors(
GCloudStorageFileInterceptor('file', {
resize: { width: 500, height: 400 },
}),
)
uploadFile(@uploadedfile() file) {
console.log(file);
}

You can pass an array of size options to resize a single image into different sizes as follows:
@post('upload')
@UseInterceptors(
GCloudStorageFileInterceptor('file', {
resizeMultiple: [
{ suffix: 'sm', width: 200, height: 200 },
{ suffix: 'md', width: 300, height: 300 },
{ suffix: 'lg', width: 400, height: 400 },
],
}
)
uploadFile(@uploadedfile() file) {
console.log(file);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant