Image Editor 🌈
Rusty
发布于 2022-11-27 / 25 阅读 / 0 评论 / 0 点赞

Image Editor 🌈

One of the most-requested Uppy features, the Image Editor, has landed (as beta) in 1.18.

The editor currently supports cropping, resizing, rotating, flipping and zooming your images in and out. You can try it out on the Dashboard example page.

Under the hood we are using the excellent open source (just like Uppy itself) Cropper.js library.

npm install @uppy/image-editor
const Uppy = require('@uppy/core')
const Dashboard = require('@uppy/dashboard')
const ImageEditor = require('@uppy/image-editor')

const uppy = new Uppy()
uppy.use(Dashboard)
uppy.use(ImageEditor, {
  target: Dashboard,
  quality: 0.8, // for the resulting image, 0.8 is a sensible default
})

Uppy with Image Editor plugin screenshot — cropping, rotating and resizing images

The Image Editor plugin is meant to be used with the Dashboard UI, but in theory it can work without it, rendered somewhere else. This has not been tested, try at your own risk ;-)