@jimp/plugin-crop
Advanced tools
Comparing version 0.6.4 to 0.6.5-canary.784.118.0
@@ -221,6 +221,6 @@ "use strict"; | ||
westPixelsToCrop = westPixelsToCrop - leaveBorder; | ||
eastPixelsToCrop = eastPixelsToCrop - leaveBorder; | ||
northPixelsToCrop = northPixelsToCrop - leaveBorder; | ||
southPixelsToCrop = southPixelsToCrop - leaveBorder; | ||
westPixelsToCrop -= leaveBorder; | ||
eastPixelsToCrop -= leaveBorder; | ||
northPixelsToCrop -= leaveBorder; | ||
southPixelsToCrop -= leaveBorder; | ||
@@ -227,0 +227,0 @@ if (cropSymmetric) { |
@@ -208,6 +208,6 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
westPixelsToCrop = westPixelsToCrop - leaveBorder; | ||
eastPixelsToCrop = eastPixelsToCrop - leaveBorder; | ||
northPixelsToCrop = northPixelsToCrop - leaveBorder; | ||
southPixelsToCrop = southPixelsToCrop - leaveBorder; | ||
westPixelsToCrop -= leaveBorder; | ||
eastPixelsToCrop -= leaveBorder; | ||
northPixelsToCrop -= leaveBorder; | ||
southPixelsToCrop -= leaveBorder; | ||
@@ -214,0 +214,0 @@ if (cropSymmetric) { |
{ | ||
"name": "@jimp/plugin-crop", | ||
"version": "0.6.4", | ||
"version": "0.6.5-canary.784.118.0", | ||
"description": "crop an image.", | ||
@@ -22,8 +22,8 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@jimp/utils": "^0.6.4", | ||
"@jimp/utils": "0.6.5-canary.784.118.0", | ||
"core-js": "^2.5.7" | ||
}, | ||
"devDependencies": { | ||
"@jimp/custom": "^0.6.4", | ||
"@jimp/test-utils": "^0.6.4" | ||
"@jimp/custom": "0.6.5-canary.784.118.0", | ||
"@jimp/test-utils": "0.6.5-canary.784.118.0" | ||
}, | ||
@@ -36,3 +36,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "7c9d3c817cade88d4a20422be10670d3c1528429" | ||
"gitHead": "20a24e11c6ef9b5ff9ed731f9a2d356fb8142518" | ||
} |
@@ -210,6 +210,6 @@ /* eslint-disable no-labels */ | ||
// apply leaveBorder | ||
westPixelsToCrop = westPixelsToCrop - leaveBorder; | ||
eastPixelsToCrop = eastPixelsToCrop - leaveBorder; | ||
northPixelsToCrop = northPixelsToCrop - leaveBorder; | ||
southPixelsToCrop = southPixelsToCrop - leaveBorder; | ||
westPixelsToCrop -= leaveBorder; | ||
eastPixelsToCrop -= leaveBorder; | ||
northPixelsToCrop -= leaveBorder; | ||
southPixelsToCrop -= leaveBorder; | ||
@@ -216,0 +216,0 @@ if (cropSymmetric) { |
@@ -286,36 +286,2 @@ import { Jimp, mkJGD } from '@jimp/test-utils'; | ||
}); | ||
it('image with top and bottom frame and leaveBorder', async () => { | ||
const imgSrc = await Jimp.read( | ||
mkJGD( | ||
'▥▥▥▥▥▥▥▥', | ||
'▥▥▥▥▥▥▥▥', | ||
'▥▥▥▥▥▥▥▥', | ||
' ◆◆ ', | ||
' ◆▦▦◆ ', | ||
' ◆▦▦▦▦◆ ', | ||
' ◆▦▦◆ ', | ||
' ◆◆ ', | ||
'▥▥▥▥▥▥▥▥', | ||
'▥▥▥▥▥▥▥▥', | ||
'▥▥▥▥▥▥▥▥' | ||
) | ||
); | ||
imgSrc | ||
.autocrop({ cropSymmetric: true, cropOnlyFrames: false, leaveBorder: 2 }) | ||
.getJGDSync() | ||
.should.be.sameJGD( | ||
mkJGD( | ||
'▥▥▥▥▥▥▥▥', | ||
'▥▥▥▥▥▥▥▥', | ||
' ◆◆ ', | ||
' ◆▦▦◆ ', | ||
' ◆▦▦▦▦◆ ', | ||
' ◆▦▦◆ ', | ||
' ◆◆ ', | ||
'▥▥▥▥▥▥▥▥', | ||
'▥▥▥▥▥▥▥▥' | ||
) | ||
); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
77404
891
+ Added@jimp/utils@0.6.5-canary.784.118.0(transitive)
- Removed@jimp/utils@0.6.8(transitive)