diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fe8de6..6b197fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog). ## [Unreleased](https://github.com/idealista/yatm/tree/develop) +## [2.1.2](https://github.com/idealista/yatm/tree/2.1.2) +### Fixed +- [#36](https://github.com/idealista/yatm/issues/36) *Fix another segmentation fault* @jmonterrubio ## [2.1.1](https://github.com/idealista/yatm/tree/2.1.1) ### Fixed - [#36](https://github.com/idealista/yatm/issues/36) *Fix segmentation fault* @jmonterrubio diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 45e84c9..b0c276e 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -10,7 +10,7 @@ pkg: "{{ item }}" state: present with_items: - - libturbojpeg0-dev + - libjpeg62-turbo-dev - libtiff-dev - libgsf-1-dev - liblcms2-dev diff --git a/molecule/default/group_vars/yatm/main.yml b/molecule/default/group_vars/yatm/main.yml index b86b739..6aee337 100644 --- a/molecule/default/group_vars/yatm/main.yml +++ b/molecule/default/group_vars/yatm/main.yml @@ -2,8 +2,7 @@ nodejs_version: 14.17.0 -vips_version: 8.11.2 -# vips_force_reinstall: true +vips_version: 8.10.0 yatm_install_path: /opt/yatm @@ -28,7 +27,7 @@ yatm_build_libraries: - /usr/lib/x86_64-linux-gnu/libSM - /usr/lib/x86_64-linux-gnu/libICE - /usr/lib/x86_64-linux-gnu/libpng - - /usr/lib/x86_64-linux-gnu/libturbojpeg + - /usr/lib/x86_64-linux-gnu/libjpeg - /usr/lib/x86_64-linux-gnu/libtiff - /usr/lib/x86_64-linux-gnu/libgsf-1 - /usr/lib/x86_64-linux-gnu/liblcms2 diff --git a/package-lock.json b/package-lock.json index ff79ae5..70a2930 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "yatm", - "version": "2.1.1", + "version": "2.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index dcc7a41..a61a1ff 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "yatm", "description": "Yet Another Thumbnail Manager. A libvips wrapper for Node.js", "author": "idealista (http://www.idealista.com/labs/blog/)", - "version": "2.1.1", + "version": "2.1.2", "homepage": "https://github.com/idealista/yatm", "private": false, "dependencies": { diff --git a/src/image.cc b/src/image.cc index 22da51f..93b66af 100644 --- a/src/image.cc +++ b/src/image.cc @@ -86,7 +86,7 @@ namespace image { Image* Init(void *buffer, size_t const length) { Image *thumb = NULL; - VipsImage *out = vips_image_new_from_buffer(buffer, length, "", "access", VIPS_ACCESS_RANDOM, NULL); + VipsImage *out = vips_image_new_from_buffer(buffer, length, NULL, "access", VIPS_ACCESS_RANDOM, NULL); if (out != NULL) { thumb = new Image; thumb->img = out; diff --git a/test/unit/resize.js b/test/unit/resize.js index 9a902b2..f01dc87 100644 --- a/test/unit/resize.js +++ b/test/unit/resize.js @@ -1,8 +1,12 @@ 'use strict'; +var fs = require('fs'); var thumb = require('../../index'); var image1 = 'test/unit/images/1.png'; +var buffer1 = fs.readFileSync(image1); +var image2 = 'test/unit/images/1.jpg'; +var buffer2 = fs.readFileSync(image2); module.exports = { setUp : function(callback) { @@ -26,6 +30,39 @@ module.exports = { } ); }, + testResizeBasicBuffer: function(assert) { + thumb(buffer1) + .resize(this.options.width,this.options.height) + .toBuffer( + function (err, data) { + assert.ok(!err, 'unexpected error: ' + err); + assert.notEqual(data, undefined); + assert.done(); + } + ); + }, + testResizeBasicJpg: function(assert) { + thumb(image2) + .resize(this.options.width,this.options.height) + .toBuffer( + function (err, data) { + assert.ok(!err, 'unexpected error: ' + err); + assert.notEqual(data, undefined); + assert.done(); + } + ); + }, + testResizeBasicBufferJpg: function(assert) { + thumb(buffer2) + .resize(this.options.width,this.options.height) + .toBuffer( + function (err, data) { + assert.ok(!err, 'unexpected error: ' + err); + assert.notEqual(data, undefined); + assert.done(); + } + ); + }, testResizeNoHeight: function(assert) { assert.throws(function(){ thumb(image1)