2

I'm trying to use jimp to convert an image to JPG and keep a maximum size e.g. 1920x1920 keeping the original aspect ratio

However, some of my input files are smaller than that size.

I am thinking it is image.scaleToFit(1920, 1920, Jimp.AUTO) but make it so that it doesn't not resize if it is smaller.

I'm using Jimp because of Cordova, I need a pure JS solution as there is no plugin I found for Cordova that would do this transformation.

Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265

0 Answers0