Remove stray win32 library that was causing segfaults

Explicit int cast to prevent 'loss of precision' warnings

Remove unnecessary semver checking from I/O tests
This commit is contained in:
Lovell Fuller 2015-11-21 22:18:39 +00:00
parent 05dd191e17
commit 0ae619dfc5
4 changed files with 134 additions and 133 deletions

View File

@ -165,7 +165,6 @@
'<(module_root_dir)/lib/libgmodule-2.0-0.dll', '<(module_root_dir)/lib/libgmodule-2.0-0.dll',
'<(module_root_dir)/lib/libgobject-2.0-0.dll', '<(module_root_dir)/lib/libgobject-2.0-0.dll',
'<(module_root_dir)/lib/libgsf-1-114.dll', '<(module_root_dir)/lib/libgsf-1-114.dll',
'<(module_root_dir)/lib/libgsf-win32-1-114.dll',
'<(module_root_dir)/lib/libgthread-2.0-0.dll', '<(module_root_dir)/lib/libgthread-2.0-0.dll',
'<(module_root_dir)/lib/libintl-8.dll', '<(module_root_dir)/lib/libintl-8.dll',
'<(module_root_dir)/lib/libjpeg-62.dll', '<(module_root_dir)/lib/libjpeg-62.dll',

View File

@ -11,6 +11,6 @@ RUN unzip vips-dev-w64-8.1.1-2.zip
# Clean and zip # Clean and zip
WORKDIR /vips/vips-dev-8.1.1 WORKDIR /vips/vips-dev-8.1.1
RUN rm bin/libvipsCC-42.dll bin/libvips-cpp-42.dll RUN rm bin/libvipsCC-42.dll bin/libvips-cpp-42.dll bin/libgsf-win32-1-114.dll
RUN cp bin/*.dll lib/ RUN cp bin/*.dll lib/
RUN GZIP=-9 tar czf /libvips-8.1.1-win.tar.gz include lib/glib-2.0 lib/libvips.lib lib/libglib-2.0.lib lib/libgobject-2.0.lib lib/*.dll RUN GZIP=-9 tar czf /libvips-8.1.1-win.tar.gz include lib/glib-2.0 lib/libvips.lib lib/libglib-2.0.lib lib/libgobject-2.0.lib lib/*.dll

View File

@ -7,11 +7,12 @@
#include "operations.h" #include "operations.h"
#include "utilities.h" #include "utilities.h"
using v8::Local;
using v8::Object;
using v8::Number;
using v8::String;
using v8::Boolean; using v8::Boolean;
using v8::Integer;
using v8::Local;
using v8::Number;
using v8::Object;
using v8::String;
using Nan::HandleScope; using Nan::HandleScope;
using Nan::New; using Nan::New;
@ -38,10 +39,16 @@ NAN_METHOD(cache) {
// Get cache statistics // Get cache statistics
Local<Object> cache = New<Object>(); Local<Object> cache = New<Object>();
Set(cache, New("current").ToLocalChecked(), New<Number>(vips_tracked_get_mem() / 1048576)); Set(cache, New("current").ToLocalChecked(),
Set(cache, New("high").ToLocalChecked(), New<Number>(vips_tracked_get_mem_highwater() / 1048576)); New<Integer>(static_cast<int>(round(vips_tracked_get_mem() / 1048576)))
Set(cache, New("memory").ToLocalChecked(), New<Number>(vips_cache_get_max_mem() / 1048576)); );
Set(cache, New("items").ToLocalChecked(), New<Number>(vips_cache_get_max())); Set(cache, New("high").ToLocalChecked(),
New<Integer>(static_cast<int>(round(vips_tracked_get_mem_highwater() / 1048576)))
);
Set(cache, New("memory").ToLocalChecked(),
New<Integer>(static_cast<int>(round(vips_cache_get_max_mem() / 1048576)))
);
Set(cache, New("items").ToLocalChecked(), New<Integer>(vips_cache_get_max()));
info.GetReturnValue().Set(cache); info.GetReturnValue().Set(cache);
} }
@ -56,7 +63,7 @@ NAN_METHOD(concurrency) {
vips_concurrency_set(To<int32_t>(info[0]).FromJust()); vips_concurrency_set(To<int32_t>(info[0]).FromJust());
} }
// Get concurrency // Get concurrency
info.GetReturnValue().Set(New<Number>(vips_concurrency_get())); info.GetReturnValue().Set(New<Integer>(vips_concurrency_get()));
} }
/* /*
@ -68,8 +75,8 @@ NAN_METHOD(counters) {
HandleScope(); HandleScope();
Local<Object> counters = New<Object>(); Local<Object> counters = New<Object>();
Set(counters, New("queue").ToLocalChecked(), New<Number>(counterQueue)); Set(counters, New("queue").ToLocalChecked(), New<Integer>(counterQueue));
Set(counters, New("process").ToLocalChecked(), New<Number>(counterProcess)); Set(counters, New("process").ToLocalChecked(), New<Integer>(counterProcess));
info.GetReturnValue().Set(counters); info.GetReturnValue().Set(counters);
} }

View File

@ -3,8 +3,6 @@
var fs = require('fs'); var fs = require('fs');
var assert = require('assert'); var assert = require('assert');
var semver = require('semver');
var sharp = require('../../index'); var sharp = require('../../index');
var fixtures = require('../fixtures'); var fixtures = require('../fixtures');
@ -483,8 +481,7 @@ describe('Input/output', function() {
done(); done();
}); });
if (semver.gte(sharp.libvipsVersion(), '7.42.0')) { it('withoutAdaptiveFiltering generates smaller file', function(done) {
it('withoutAdaptiveFiltering generates smaller file [libvips ' + sharp.libvipsVersion() + '>=7.42.0]', function(done) {
// First generate with adaptive filtering // First generate with adaptive filtering
sharp(fixtures.inputPng) sharp(fixtures.inputPng)
.resize(320, 240) .resize(320, 240)
@ -512,8 +509,6 @@ describe('Input/output', function() {
}); });
}); });
}); });
}
}); });
it('Without chroma subsampling generates larger file', function(done) { it('Without chroma subsampling generates larger file', function(done) {
@ -545,8 +540,7 @@ describe('Input/output', function() {
}); });
}); });
if (semver.gte(sharp.libvipsVersion(), '8.0.0')) { it('Trellis quantisation', function(done) {
it('Trellis quantisation [libvips ' + sharp.libvipsVersion() + '>=8.0.0]', function(done) {
// First generate without // First generate without
sharp(fixtures.inputJpg) sharp(fixtures.inputJpg)
.resize(320, 240) .resize(320, 240)
@ -575,7 +569,8 @@ describe('Input/output', function() {
}); });
}); });
}); });
it('Overshoot deringing [libvips ' + sharp.libvipsVersion() + '>=8.0.0]', function(done) {
it('Overshoot deringing', function(done) {
// First generate without // First generate without
sharp(fixtures.inputJpg) sharp(fixtures.inputJpg)
.resize(320, 240) .resize(320, 240)
@ -602,7 +597,8 @@ describe('Input/output', function() {
}); });
}); });
}); });
it('Optimise scans [libvips ' + sharp.libvipsVersion() + '>=8.0.0]', function(done) {
it('Optimise scans', function(done) {
// First generate without // First generate without
sharp(fixtures.inputJpg) sharp(fixtures.inputJpg)
.resize(320, 240) .resize(320, 240)
@ -631,7 +627,6 @@ describe('Input/output', function() {
}); });
}); });
}); });
}
if (sharp.format.magick.input.file) { if (sharp.format.magick.input.file) {
it('Convert SVG, if supported, to PNG', function(done) { it('Convert SVG, if supported, to PNG', function(done) {