-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base64 image #13
Comments
Fixed by #14 |
I am still having issues with this. I made a very simple demo and ran it locally like this: I run this locally: import { loadImage, createCanvas } from 'https://deno.land/x/canvas/mod.ts'
const imgData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYAgMAAACdGdVrAAAACVBMVEUAAADk5+P///9QNmNfAAAAWUlEQVQI112NsQ2AMAwEP8gVlWtKSqYg6zBKKrwDDT8lthUJQnUvv+6NAsUuqKJaJZIW/NA7T3EpE6/AzBvurY3hkTR80Bx142LpHWdA+cI3afkvhQG9G4QH3GofsqbaWK8AAAAASUVORK5CYII='
async function main () {
const canvas = createCanvas(800, 800)
const ctx = canvas.getContext('2d')
ctx.imageSmoothingEnabled = false
const img = await loadImage(imgData)
ctx.drawImage(img, 0, 0, canvas.width, canvas.height)
}
main()
it seems like it's still trying to use a local file. I looked at the canvas version that I get linked to, and it's this: https://deno.land/x/canvas@v1.3.0/src/canvas.ts (no new data-url code.) Does it need to be tagged? |
It's not released in any new version yet, you'll have to use main branch/the commit |
Sorry, I wasn't thinking. Changing the import works great: import { loadImage, createCanvas } from 'https://raw.githubusercontent.com/DjDeveloperr/deno-canvas/master/mod.ts' |
I am working on this cross-canvas demo to demonstrate using roughly the same code (with a different frame around it) in browser vs deno. I use a base64-image to keep the demo self-contained, and when I run it in deno, I get this:
Do I need to do something special to base64 images?
The text was updated successfully, but these errors were encountered: