@fengsi/imgproxy v2.1.1
@fengsi/imgproxy
const imgproxy = new Init("https://imgproxy.example.com"); // or const imgproxy = new CryptographicInit({ salt: process.env.IMGPROXY_SALT, key: process.env.IMGPROXY_KEY, baseUrl: "https://imgproxy.example.com" })
const url = imgproxy.getNewUrl({ url: "https://example.com/01.jpg", width: 250, height: 50, quality: 90, gravity: "ce", format: "webp" })
// https://imgproxy.example.com/pr:sharp/rs:fill:250:50:1/g:ce/q:90/LzAxLmpwZw.webp
const imgproxy = new TencentInit({ bucket: "bucketName-1250000000", region: "ap-shanghai", protocol: "https", key: "imageMogr2" })
const url = imgproxy.getNewUrl({ url: "https://example.com/gf/YYJdslldjjd.jpg", gravity: "so", width: 600, height: 50, quality: 70, format: "webp" })
const imgproxy = new TencentInit({ baseUrl: "https://imgproxy.example.com" });
const url = imgproxy.getNewUrl({ url: "https://example.com/gf/YYJdslldjjd.jpg", gravity: "so", width: 600, height: 50, quality: 70, format: "webp" });