mirror of
https://github.com/ColonelParrot/jscanify.git
synced 2025-12-31 06:31:54 +00:00
Ensure demo image is loaded before extracting paper.
This commit is contained in:
parent
eecb41ff37
commit
196e8393aa
@ -32,11 +32,13 @@ $('#demo-images .image-container').click(function () {
|
|||||||
const newImg = document.createElement("img")
|
const newImg = document.createElement("img")
|
||||||
newImg.src = imageSrc
|
newImg.src = imageSrc
|
||||||
|
|
||||||
scanner.extractPaper(newImg, 386, 500, (resultCanvas) => {
|
newImg.onload = function(){
|
||||||
$('#demo-result').append(resultCanvas);
|
scanner.extractPaper(newImg, 386, 500, (resultCanvas) => {
|
||||||
|
$('#demo-result').append(resultCanvas);
|
||||||
|
|
||||||
const highlightedCanvas = scanner.highlightPaper(newImg)
|
const highlightedCanvas = scanner.highlightPaper(newImg)
|
||||||
$('#demo-result').append(highlightedCanvas);
|
$('#demo-result').append(highlightedCanvas);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user