Flexin' new features (drag and drop + panel)

Updated to new drop API on 4/11/2021

Install rotate-dropped-image

// Menu: Rotate Dropped Image
// Description: Drop an image in and rotate it
// Author: John Lindquist
// Twitter: @johnlindquist
let sharp = await npm("sharp")
let [file] = await arg({
placeholder: "Drop an image",
drop: true,
ignoreBlur: true,
})
await arg("Rotate:", async input => {
let rotate = 0
try {
rotate = parseInt(input || 0, 10)
} catch {}
let buffer = await sharp(file.path)
.rotate(rotate)
.toBuffer()
return `
<img style="height:10rem" src="data:image/jpg;base64,${buffer.toString(
"base64"
)}" alt="">
`
})