A Node.js module that provides access to the VIPS library and Exiv2 in order to resize and rotate images.
Node.js installed. Tested with v14.17.0.
In version 2.0.0, the support for nodejs <= 8 and debian != buster is discontinued and not tested.
$ npm install yatm
In order to avoid external dependencies, add
LD_LIBRARY_PATH={{path to project/global node_modules}}/yatm/deps/lib/
to your Node.js environment. Usually:
export LD_LIBRARY_PATH={{path to project/global node_modules}}/yatm/deps/lib/
-
(path)
Set the thumb object with an input path.
-
(buffer)
Set the thumb object with an input buffer.
-
resize(width,height)
The resized values. One of both could be 0, so the result will adjust to the non zero side.
-
rotate(rotate)
Thumb rotation.
- Values: {0,90,180,270}
-
quality(quality)
Desired thumb quality.
- Values: {0-100}
-
adjust(adjust)
Adjusts the image to the width ('wi') or height ('he') if one of them are 0 setted. Usually setted with crop.
- Values: {'wi', 'he'}
-
crop(crop)
Crops the thumb if the resized result doesn't match current ratio, avoiding deformation.
- Values: {true,false}
-
toBuffer(callback)
Transform the thumb object with the desired options and returns the image as a buffer.
- Unit testing
$ npm test
- Memory leak
$ ./test/memoryleak/memoryleak.sh
- Full testing, that creates a docker container and installs all dependencies
$ molecule test
For the versions available, see the tags on this repository.
Additionaly you can see what change in each version in the CHANGELOG.md file.
- Idealista - Work with - idealista
See also the list of contributors who participated in this project.
This project is licensed under the Apache 2.0 license - see the LICENSE file for details.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.