Giter Site home page Giter Site logo

idealista / yatm Goto Github PK

View Code? Open in Web Editor NEW
11.0 27.0 1.0 826 KB

A node.js module that provides access to the VIPS library and Exiv2 in order to resize and rotate images.

License: Apache License 2.0

JavaScript 46.00% Makefile 0.53% Python 1.87% C++ 49.39% Shell 1.41% Jinja 0.81%
nodejs image-processing thumbnail image-processing-library exiv2 libvips image-resizer watermarking-image

yatm's Introduction

Logo

Build Status npm version

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

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

Ansible Molecule Goss

Versioning

For the versions available, see the tags on this repository.

Additionaly you can see what change in each version in the CHANGELOG.md file.

Authors

See also the list of contributors who participated in this project.

License

License

This project is licensed under the Apache 2.0 license - see the LICENSE file for details.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

yatm's People

Contributors

dortegau avatar jmonterrubio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

widgetic

yatm's Issues

Error publishing npm package from travis

Description

npm ERR! publish Failed PUT 404
npm ERR! code E404
npm ERR! 404 Not found : yatm
npm ERR! 404
npm ERR! 404 'yatm' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Exiv2 download sources package is not working properly

Prerequisites

Description

Download URL is giving a timeout:

TASK [exiv2 : EXIV2 | Download sources package] ******************************** [DEPRECATION WARNING]: Using tests as filters is deprecated. Instead of using result|failedinstead useresult is failed. This feature will be removed in version 2.9. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. fatal: [yatm.cont]: FAILED! => {"changed": false, "dest": "/buildexiv2", "gid": 0, "group": "root", "mode": "0755", "msg": "Connection failure: timed out", "owner": "root", "size": 4096, "state": "directory", "uid": 0, "url": "http://www.exiv2.org/builds/exiv2-0.26-trunk.tar.gz"}

Versions

All

[BUG]Segmentation fault

Description

GLib-GObject-CRITICAL **: 13:26:51.922: g_value_type_compatible: assertion 'G_TYPE_IS_VALUE (src_type)' failed

Use a documentation generator

Prerequisites

Description

Maybe a documentation generator (like ESDoc or JSDoc 3) should be used.

That static page should be linked in Readme file. Must be regenerated every time a change is pushed in source code.

Additional Information

Create a CLI for this project

Prerequisites

Description

Would be great if YATM could be executed through terminal using a Command-line interface

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.