https://github.com/idealista/yatm
A node.js module that provides access to the VIPS library and Exiv2 in order to resize and rotate images.
https://github.com/idealista/yatm
exiv2 image-processing image-processing-library image-resizer libvips nodejs thumbnail watermarking-image
Last synced: about 1 year ago
JSON representation
A node.js module that provides access to the VIPS library and Exiv2 in order to resize and rotate images.
- Host: GitHub
- URL: https://github.com/idealista/yatm
- Owner: idealista
- License: apache-2.0
- Created: 2016-02-02T12:32:42.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-07-20T07:01:50.000Z (almost 5 years ago)
- Last Synced: 2025-04-15T03:16:38.070Z (about 1 year ago)
- Topics: exiv2, image-processing, image-processing-library, image-resizer, libvips, nodejs, thumbnail, watermarking-image
- Language: C++
- Homepage:
- Size: 807 KB
- Stars: 11
- Watchers: 27
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README

[](https://travis-ci.com/idealista/yatm)
[](https://badge.fury.io/js/yatm)
# YATM - Yet Another Thumbnail Manager
A Node.js module that provides access to the VIPS library and Exiv2 in order to resize and rotate images.
- [Getting Started](#getting-started)
- [Prerequisities](#prerequisities)
- [Installing](#installing)
- [Usage](#usage)
- [Testing](#testing)
- [Built With](#built-with)
- [Versioning](#versioning)
- [Authors](#authors)
- [License](#license)
- [Contributing](#contributing)
## Getting Started
### Prerequisities
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.
## Installation
```
$ 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/
```
## Usage
* **(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.
## Testing
* Unit testing
```
$ npm test
```
* Memory leak
```
$ ./test/memoryleak/memoryleak.sh
```
* Full testing, that creates a docker container and installs all dependencies
```
$ molecule test
```
## Built With



## Versioning
For the versions available, see the [tags on this repository](https://github.com/idealista/yatm/tags).
Additionaly you can see what change in each version in the [CHANGELOG.md](CHANGELOG.md) file.
## Authors
* **Idealista** - *Work with* - [idealista](https://github.com/idealista)
See also the list of [contributors](https://github.com/idealista/yatm/contributors) who participated in this project.
## License
[](https://opensource.org/licenses/Apache-2.0)
This project is licensed under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license - see the [LICENSE](LICENSE) file for details.
## Contributing
Please read [CONTRIBUTING.md](.github/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.