jimp-dev / jimp

An image processing library written entirely in JavaScript for Node, with zero external or native dependencies.
http://jimp-dev.github.io/jimp/
MIT License
14.03k stars 760 forks source link

How to migrate to v1? #1305

Closed archasek closed 2 months ago

archasek commented 2 months ago

Is your feature request related to a problem? Please describe. I cannot find Jimp's docs on how to use it in > v1.0.0. Where's it ? :)

Describe the solution you'd like I have the old code I don't know how to migrate:

async function optimizeBase64Image(base64Image: string): Promise<string> {
  const image = await Jimp.read(Buffer.from(base64Image, "base64"));
  const resizedImage = await image.resize(512, Jimp.AUTO).quality(80).getBufferAsync(Jimp.MIME_JPEG);

  return Buffer.from(resizedImage).toString("base64");
}

Describe alternatives you've considered Tried to find docs, with no success.

Additional context {1FFC2C44-5E6F-43B8-8F03-5F29CA4DFEC2}

hipstersmoothie commented 2 months ago

I've added a migration guide here

http://jimp-dev.github.io/jimp/guides/migrate-to-v1/

if you find anything else confusing feedback welcome!

archasek commented 2 months ago

Thanks so much! <3