mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
committed by
Lovell Fuller
parent
6b34e8a804
commit
e0d622d347
BIN
test/fixtures/alpha-layer-2-ink.jpg
vendored
Normal file
BIN
test/fixtures/alpha-layer-2-ink.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
BIN
test/fixtures/expected/alpha-layer-2-trim-resize.jpg
vendored
Normal file
BIN
test/fixtures/expected/alpha-layer-2-trim-resize.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
1
test/fixtures/index.js
vendored
1
test/fixtures/index.js
vendored
@@ -65,6 +65,7 @@ module.exports = {
|
||||
inputJpgWithLowContrast: getPath('low-contrast.jpg'), // http://www.flickr.com/photos/grizdave/2569067123/
|
||||
inputJpgLarge: getPath('giant-image.jpg'),
|
||||
inputJpg320x240: getPath('320x240.jpg'), // http://www.andrewault.net/2010/01/26/create-a-test-pattern-video-with-perl/
|
||||
inputJpgOverlayLayer2: getPath('alpha-layer-2-ink.jpg'),
|
||||
|
||||
inputPng: getPath('50020484-00001.png'), // http://c.searspartsdirect.com/lis_png/PLDM/50020484-00001.png
|
||||
inputPngWithTransparency: getPath('blackbug.png'), // public domain
|
||||
|
||||
@@ -20,6 +20,20 @@ describe('Trim borders', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('Skip shrink-on-load', function (done) {
|
||||
const expected = fixtures.expected('alpha-layer-2-trim-resize.jpg');
|
||||
sharp(fixtures.inputJpgOverlayLayer2)
|
||||
.trim()
|
||||
.resize(300)
|
||||
.toBuffer(function (err, data, info) {
|
||||
if (err) throw err;
|
||||
assert.strictEqual('jpeg', info.format);
|
||||
assert.strictEqual(300, info.width);
|
||||
assert.strictEqual(300, info.height);
|
||||
fixtures.assertSimilar(expected, data, done);
|
||||
});
|
||||
});
|
||||
|
||||
it('16-bit PNG with alpha channel', function (done) {
|
||||
sharp(fixtures.inputPngWithTransparency16bit)
|
||||
.resize(32, 32)
|
||||
|
||||
Reference in New Issue
Block a user