Skip to content

Commit

Permalink
fix names
Browse files Browse the repository at this point in the history
  • Loading branch information
Adeodonne committed Sep 13, 2023
1 parent 1cac384 commit cde945d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ const FileUploader:React.FC<Props> = ({
img.src = imageDataAsURL.current;
if (img.height > 0 && img.width > 0) {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
if (ctx !== null) {
const context = canvas.getContext('2d');
if (context !== null) {
canvas.width = img.width;
canvas.height = img.height;

ctx.drawImage(img, 0, 0);
context.drawImage(img, 0, 0);

const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
const imageData = context.getImageData(0, 0, canvas.width, canvas.height);
const { data } = imageData;

for (let i = 0; i < data.length; i += 4) {
Expand All @@ -52,7 +52,7 @@ const FileUploader:React.FC<Props> = ({
data[i + 2] = grayscale;
}

ctx.putImageData(imageData, 0, 0);
context.putImageData(imageData, 0, 0);

imageDataAsURL.current = canvas.toDataURL('image/png');
}
Expand Down

0 comments on commit cde945d

Please sign in to comment.