@jimp/plugin-crop
Advanced tools
Comparing version 0.8.5-canary.800.426.0 to 0.8.5-canary.753c2c9.0
@@ -40,3 +40,3 @@ "use strict"; | ||
var start = w * y + x << 2; | ||
var end = start + h * w << 2; | ||
var end = start + h * w << 2 + 1; | ||
this.bitmap.data = this.bitmap.data.slice(start, end); | ||
@@ -234,13 +234,13 @@ } else { | ||
southPixelsToCrop = vertical; | ||
} // make sure that crops are >= 0 | ||
} // safety checks | ||
var widthOfRemainingPixels = w - (westPixelsToCrop + eastPixelsToCrop); | ||
var heightOfRemainingPixels = h - (southPixelsToCrop + northPixelsToCrop); // make sure that crops are > 0 | ||
westPixelsToCrop = westPixelsToCrop >= 0 ? westPixelsToCrop : 0; | ||
eastPixelsToCrop = eastPixelsToCrop >= 0 ? eastPixelsToCrop : 0; | ||
northPixelsToCrop = northPixelsToCrop >= 0 ? northPixelsToCrop : 0; | ||
southPixelsToCrop = southPixelsToCrop >= 0 ? southPixelsToCrop : 0; // safety checks | ||
southPixelsToCrop = southPixelsToCrop >= 0 ? southPixelsToCrop : 0; | ||
var widthOfRemainingPixels = w - (westPixelsToCrop + eastPixelsToCrop); | ||
var heightOfRemainingPixels = h - (southPixelsToCrop + northPixelsToCrop); | ||
if (cropOnlyFrames) { | ||
@@ -247,0 +247,0 @@ // crop image if all sides should be cropped |
@@ -27,3 +27,3 @@ 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); } | ||
var start = w * y + x << 2; | ||
var end = start + h * w << 2; | ||
var end = start + h * w << 2 + 1; | ||
this.bitmap.data = this.bitmap.data.slice(start, end); | ||
@@ -221,13 +221,13 @@ } else { | ||
southPixelsToCrop = vertical; | ||
} // make sure that crops are >= 0 | ||
} // safety checks | ||
var widthOfRemainingPixels = w - (westPixelsToCrop + eastPixelsToCrop); | ||
var heightOfRemainingPixels = h - (southPixelsToCrop + northPixelsToCrop); // make sure that crops are > 0 | ||
westPixelsToCrop = westPixelsToCrop >= 0 ? westPixelsToCrop : 0; | ||
eastPixelsToCrop = eastPixelsToCrop >= 0 ? eastPixelsToCrop : 0; | ||
northPixelsToCrop = northPixelsToCrop >= 0 ? northPixelsToCrop : 0; | ||
southPixelsToCrop = southPixelsToCrop >= 0 ? southPixelsToCrop : 0; // safety checks | ||
southPixelsToCrop = southPixelsToCrop >= 0 ? southPixelsToCrop : 0; | ||
var widthOfRemainingPixels = w - (westPixelsToCrop + eastPixelsToCrop); | ||
var heightOfRemainingPixels = h - (southPixelsToCrop + northPixelsToCrop); | ||
if (cropOnlyFrames) { | ||
@@ -234,0 +234,0 @@ // crop image if all sides should be cropped |
{ | ||
"name": "@jimp/plugin-crop", | ||
"version": "0.8.5-canary.800.426.0", | ||
"version": "0.8.5-canary.753c2c9.0", | ||
"description": "crop an image.", | ||
@@ -23,8 +23,8 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@jimp/utils": "0.8.5-canary.800.426.0", | ||
"@jimp/utils": "0.8.5-canary.753c2c9.0", | ||
"core-js": "^2.5.7" | ||
}, | ||
"devDependencies": { | ||
"@jimp/custom": "0.8.5-canary.800.426.0", | ||
"@jimp/test-utils": "0.8.5-canary.800.426.0" | ||
"@jimp/custom": "0.8.5-canary.753c2c9.0", | ||
"@jimp/test-utils": "0.8.5-canary.753c2c9.0" | ||
}, | ||
@@ -37,3 +37,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "eea6165d7a8ee65bce94db45d530aa45bba72af1" | ||
"gitHead": "753c2c99505ea4cc87aeb1ac9def054b52a2e90c" | ||
} |
@@ -146,2 +146,3 @@ /* eslint-disable no-labels */ | ||
} | ||
// this row contains all pixels with the same color: increment this side pixels to crop | ||
@@ -163,2 +164,3 @@ northPixelsToCrop++; | ||
} | ||
// this column contains all pixels with the same color: increment this side pixels to crop | ||
@@ -184,2 +186,3 @@ eastPixelsToCrop++; | ||
} | ||
// this row contains all pixels with the same color: increment this side pixels to crop | ||
@@ -205,2 +208,3 @@ southPixelsToCrop++; | ||
} | ||
// this column contains all pixels with the same color: increment this side pixels to crop | ||
@@ -207,0 +211,0 @@ westPixelsToCrop++; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
81682
+ Added@jimp/utils@0.8.5-canary.753c2c9.0(transitive)
+ Addedabort-controller@3.0.0(transitive)
+ Addedbuffer@6.0.3(transitive)
+ Addedevent-target-shim@5.0.1(transitive)
+ Addedevents@3.3.0(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedreadable-stream@4.7.0(transitive)
+ Addedreadable-web-to-node-stream@3.0.3(transitive)
- Removed@jimp/utils@0.8.5-canary.800.426.0(transitive)
- Removedinherits@2.0.4(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedreadable-web-to-node-stream@3.0.2(transitive)
- Removedutil-deprecate@1.0.2(transitive)