Skip to content

Commit

Permalink
if noise 0 return empty png
Browse files Browse the repository at this point in the history
  • Loading branch information
rwv committed Nov 17, 2023
1 parent d08b3e1 commit b558db3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/scan-renderer/canvas-scan/create-noise-blob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export async function createNoiseBlob(
throw new Error("Canvas context is null");
}

if (noise === 0) {
return canvas.convertToBlob({ type: "image/png" });
}

const noiseSVG = getNoiseSVG(noise);
const noiseSVGBlob = new Blob([noiseSVG], { type: "image/svg+xml" });
const noiseSVGURL = URL.createObjectURL(noiseSVGBlob);
Expand Down

0 comments on commit b558db3

Please sign in to comment.