ysugimoto/aws-lambda-image

Support for extent

lilltiger opened this issue · 1 comments

Hi!

I need support for extent but I fail to get it to work :/

extent
composite image on background color canvas image.

gm("img.png").extent([width, height, options])

I tried to add:


if ( "extent" in this.options ) {
  const extentArgs = this.options.extent.match(cropSpec);
  const extentWidth = extentArgs[1];
  const extentHeight = extentArgs[2];
  img = img.extent(extentWidth, extentHeight);
}

to "lib/ImageResizer.js" just before the check for croping. And in the config i added:
"extent": "3000x3000",

Then I did:

make clean
make
npm run update

It compiles and I can run the script but the extent does not seem to be applied.
So I guess I am missing some important step?

Guess something just went wrong when updating, as it seems to work with this code.