8000 Fix EDGE_WRAP overwriting X with Y when Y < 0 by sjoerdthedev · Pull Request #956 · jimp-dev/jimp · GitHub
[go: up one dir, main page]

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions packages/core/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ const alphabet =
const maxHashLength = [NaN, NaN];

for (let i = 2; i < 65; i++) {
const maxHash = anyBase(anyBase.BIN, alphabet.slice(0, i))(
new Array(64 + 1).join('1')
);
const maxHash = anyBase(
anyBase.BIN,
alphabet.slice(0, i)
)(new Array(64 + 1).join('1'));
maxHashLength.push(maxHash.length);
}

Expand Down Expand Up @@ -713,7 +714,7 @@ class Jimp extends EventEmitter {
}

if (y < 0) {
xi = this.bitmap.height + y;
yi = this.bitmap.height + y;
}

if (y >= this.bitmap.height) {
Expand Down
10 changes: 7 additions & 3 deletions packages/plugin-color/test/convolution.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ describe('Convolution', function() {
.catch(done);
});

const sharpM = [[-1, -1, 0], [-1, 1, 1], [0, 1, 1]];
const sharpM = [
[-1, -1, 0],
[-1, 1, 1],
[0, 1, 1]
];

it('3x3 sharp matrix on EDGE_EXTEND', done => {
imgMid
Expand Down Expand Up @@ -96,7 +100,7 @@ describe('Convolution', function() {
.getJGDSync()
.should.be.sameJGD(
mkJGD(
'66666666',
'22222222',
'28EEE822',
'2EFFF802',
'2EF88002',
Expand All @@ -113,7 +117,7 @@ describe('Convolution', function() {
.getJGDSync()
.should.be.sameJGD(
mkJGD(
'FC06666F',
'F802222E',
'80022228',
'00022222',
'22222222',
Expand Down
0