mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Ensure sharp.format.vips is present and correct #1813
This commit is contained in:
parent
2c300754a7
commit
0778c112a9
@ -4,6 +4,11 @@
|
|||||||
|
|
||||||
Requires libvips v8.8.1.
|
Requires libvips v8.8.1.
|
||||||
|
|
||||||
|
#### v0.23.1 - TBD
|
||||||
|
|
||||||
|
* Ensure `sharp.format.vips` is present and correct (filesystem only).
|
||||||
|
[#1813](https://github.com/lovell/sharp/issues/1813)
|
||||||
|
|
||||||
#### v0.23.0 - 29<sup>th</sup> July 2019
|
#### v0.23.0 - 29<sup>th</sup> July 2019
|
||||||
|
|
||||||
* Remove `overlayWith` previously deprecated in v0.22.0.
|
* Remove `overlayWith` previously deprecated in v0.22.0.
|
||||||
|
@ -147,7 +147,7 @@ namespace sharp {
|
|||||||
case ImageType::OPENSLIDE: id = "openslide"; break;
|
case ImageType::OPENSLIDE: id = "openslide"; break;
|
||||||
case ImageType::PPM: id = "ppm"; break;
|
case ImageType::PPM: id = "ppm"; break;
|
||||||
case ImageType::FITS: id = "fits"; break;
|
case ImageType::FITS: id = "fits"; break;
|
||||||
case ImageType::VIPS: id = "v"; break;
|
case ImageType::VIPS: id = "vips"; break;
|
||||||
case ImageType::RAW: id = "raw"; break;
|
case ImageType::RAW: id = "raw"; break;
|
||||||
case ImageType::UNKNOWN: id = "unknown"; break;
|
case ImageType::UNKNOWN: id = "unknown"; break;
|
||||||
case ImageType::MISSING: id = "missing"; break;
|
case ImageType::MISSING: id = "missing"; break;
|
||||||
|
@ -150,8 +150,9 @@ NAN_METHOD(format) {
|
|||||||
|
|
||||||
// Which load/save operations are available for each compressed format?
|
// Which load/save operations are available for each compressed format?
|
||||||
Local<Object> format = New<Object>();
|
Local<Object> format = New<Object>();
|
||||||
for (std::string f : {
|
for (std::string const f : {
|
||||||
"jpeg", "png", "webp", "tiff", "magick", "openslide", "dz", "ppm", "fits", "gif", "svg", "heif", "pdf", "v"
|
"jpeg", "png", "webp", "tiff", "magick", "openslide", "dz",
|
||||||
|
"ppm", "fits", "gif", "svg", "heif", "pdf", "vips"
|
||||||
}) {
|
}) {
|
||||||
// Input
|
// Input
|
||||||
Local<Boolean> hasInputFile =
|
Local<Boolean> hasInputFile =
|
||||||
|
@ -232,6 +232,26 @@ describe('Image metadata', function () {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
it('vips', () =>
|
||||||
|
sharp(fixtures.inputV)
|
||||||
|
.metadata()
|
||||||
|
.then(metadata => {
|
||||||
|
assert.strictEqual('vips', metadata.format);
|
||||||
|
assert.strictEqual('undefined', typeof metadata.size);
|
||||||
|
assert.strictEqual(70, metadata.width);
|
||||||
|
assert.strictEqual(60, metadata.height);
|
||||||
|
assert.strictEqual(3, metadata.channels);
|
||||||
|
assert.strictEqual('uchar', metadata.depth);
|
||||||
|
assert.strictEqual(72, metadata.density);
|
||||||
|
assert.strictEqual('undefined', typeof metadata.chromaSubsampling);
|
||||||
|
assert.strictEqual(false, metadata.isProgressive);
|
||||||
|
assert.strictEqual(false, metadata.hasProfile);
|
||||||
|
assert.strictEqual(false, metadata.hasAlpha);
|
||||||
|
assert.strictEqual('undefined', typeof metadata.orientation);
|
||||||
|
assert.strictEqual('undefined', typeof metadata.exif);
|
||||||
|
assert.strictEqual('undefined', typeof metadata.icc);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
it('File in, Promise out', function (done) {
|
it('File in, Promise out', function (done) {
|
||||||
sharp(fixtures.inputJpg).metadata().then(function (metadata) {
|
sharp(fixtures.inputJpg).metadata().then(function (metadata) {
|
||||||
|
@ -118,6 +118,13 @@ describe('Utilities', function () {
|
|||||||
assert.strictEqual(true, sharp.format.raw[direction].stream);
|
assert.strictEqual(true, sharp.format.raw[direction].stream);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
it('vips format supports filesystem only', function () {
|
||||||
|
['input', 'output'].forEach(function (direction) {
|
||||||
|
assert.strictEqual(true, sharp.format.vips[direction].file);
|
||||||
|
assert.strictEqual(false, sharp.format.vips[direction].buffer);
|
||||||
|
assert.strictEqual(false, sharp.format.vips[direction].stream);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Versions', function () {
|
describe('Versions', function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user