From fd124a4a286b9dce58162882a50002579456d833 Mon Sep 17 00:00:00 2001 From: egordidenko Date: Tue, 20 Feb 2024 12:13:25 +0300 Subject: [PATCH 1/2] docs: added description image shrink --- packages/image-shrink/README.md | 61 +++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/packages/image-shrink/README.md b/packages/image-shrink/README.md index e69de29bb..105f1000b 100644 --- a/packages/image-shrink/README.md +++ b/packages/image-shrink/README.md @@ -0,0 +1,61 @@ +# Uploadcare Image Shrink + + + + + +File Uploader lets you accept hi-res images and shrink them in size to a reasonable resolution, keeping the original aspect ratio. See docs [here][uc-docs-image-shrink]. + +[![Build Status][badge-build]][build-url] +[![NPM version][npm-img]][npm-url] +[![GitHub release][badge-release-img]][badge-release-url] +[![Uploadcare stack on StackShare][badge-stack-img]][badge-stack-url] + + + +- [Install](#install) +- [Usage](#usage) +- [Security issues](#security-issues) +- [Feedback](#feedback) + + + +## Install + +```bash +npm install @uploadcare/image-shrink +``` + +## Usage + +```typescript +import { shrinkFile } from '@uploadcare/image-shrink' +``` + +## Security issues + +If you think you ran into something in Uploadcare libraries that might have +security implications, please hit us up at +[bugbounty@uploadcare.com][uc-email-bounty] or Hackerone. + +We'll contact you personally in a short time to fix an issue through co-op and +prior to any public disclosure. + +## Feedback + +Issues and PRs are welcome. You can provide your feedback or drop us a support +request at [hello@uploadcare.com][uc-email-hello]. + +[uc-email-bounty]: mailto:bugbounty@uploadcare.com +[uc-email-hello]: mailto:hello@uploadcare.com +[badge-stack-img]: https://img.shields.io/badge/tech-stack-0690fa.svg?style=flat +[badge-stack-url]: https://stackshare.io/uploadcare/stacks/ +[badge-release-img]: https://img.shields.io/github/release/uploadcare/uploadcare-js-api-clients.svg +[badge-release-url]: https://github.com/uploadcare/uploadcare-js-api-clients/releases +[npm-img]: http://img.shields.io/npm/v/@uploadcare/signed-uploads.svg +[npm-url]: https://www.npmjs.org/package/@uploadcare/signed-uploads +[badge-build]: https://github.com/uploadcare/uploadcare-js-api-clients/actions/workflows/checks.yml/badge.svg +[build-url]: https://github.com/uploadcare/uploadcare-js-api-clients/actions/workflows/checks.yml +[uc-docs-image-shrink]: https://uploadcare.com/docs/file-uploader/feature-shrink/ From 937a5f987c0131c041c72b199ff8c4072f4e1452 Mon Sep 17 00:00:00 2001 From: egordidenko Date: Tue, 20 Feb 2024 12:32:51 +0300 Subject: [PATCH 2/2] docs: update readme.md --- packages/image-shrink/README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/image-shrink/README.md b/packages/image-shrink/README.md index 105f1000b..3c69de7cb 100644 --- a/packages/image-shrink/README.md +++ b/packages/image-shrink/README.md @@ -6,7 +6,9 @@ alt=""> -File Uploader lets you accept hi-res images and shrink them in size to a reasonable resolution, keeping the original aspect ratio. See docs [here][uc-docs-image-shrink]. +File Uploader lets you accept hi-res images and shrink them in size to a reasonable resolution, keeping the original aspect ratio. See docs [here][uc-docs-image-shrink] wrapper to work with browser. + +[API Reference](https://uploadcare.github.io/uploadcare-js-api-clients/image-shrink/) [![Build Status][badge-build]][build-url] [![NPM version][npm-img]][npm-url] @@ -32,6 +34,11 @@ npm install @uploadcare/image-shrink ```typescript import { shrinkFile } from '@uploadcare/image-shrink' + +const shrinkedBlob = shrinkImage(blob, { + size: number, + quality?: number +}) ``` ## Security issues