Skip to content

Commit 1768b8b

Browse files
Fix image padding (#1015)
1 parent 23647e2 commit 1768b8b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/utils/image.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,13 +428,14 @@ export class RawImage {
428428
// Draw image to context, padding in the process
429429
ctx.drawImage(canvas,
430430
0, 0, this.width, this.height,
431-
left, top, newWidth, newHeight
431+
left, top, this.width, this.height
432432
);
433433

434434
// Create image from the padded data
435435
const paddedImage = new RawImage(
436436
ctx.getImageData(0, 0, newWidth, newHeight).data,
437-
newWidth, newHeight, 4);
437+
newWidth, newHeight, 4
438+
);
438439

439440
// Convert back so that image has the same number of channels as before
440441
return paddedImage.convert(numChannels);

0 commit comments

Comments
 (0)