1.0.2 • Published 3 years ago
oss-src v1.0.2
dispose aliyun oss url
- 图片缩放
- 图片水印
- 质量变换
- 格式转换
- 图片水印
- install
yarn add oss-src
// or
npm install oss-src
- use
import OssSrc from 'oss-src';
// change image type
const newUrl = new OssSrc('https://image-demo.oss-cn-hangzhou.aliyuncs.com/example.jpg').format('webp').getUrl();
// add watermark
const newUrl = new OssSrc('https://image-demo.oss-cn-hangzhou.aliyuncs.com/example.jpg')
.watermarkLocation(100, 'center', 1, 1, 1)
.watermarkText('我们')
.getUrl(),