-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
fix(ext/web): pass createImageBitmap
when the argument type is Blob
#23518
Conversation
- pass buffer with Unit8Array when the type of argument is `Blob` - decode with `DynamicImage`
BTW, the reason that I switched to % target/debug/deno run -A blob.ts
============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.
Platform: macos aarch64
Version: 1.42.4
Args: ["target/debug/deno", "run", "-A", "blob.ts"]
thread 'main' panicked at /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/image-0.24.9/src/codecs/png.rs:271:9:
assertion `left == right` failed
left: Ok(0)
right: Ok(16384)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
user@name deno % RUST_BACKTRACE=1 target/debug/deno run -A blob.ts
============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.
Platform: macos aarch64
Version: 1.42.4
Args: ["target/debug/deno", "run", "-A", "blob.ts"]
thread 'main' panicked at /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/image-0.24.9/src/codecs/png.rs:271:9:
assertion `left == right` failed
left: Ok(0)
right: Ok(16384)
stack backtrace:
0: rust_begin_unwind
at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/std/src/panicking.rs:647:5
1: core::panicking::panic_fmt
at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/panicking.rs:72:14
2: core::panicking::assert_failed_inner
3: core::panicking::assert_failed
at /rustc/25ef9e3d85d934b27d9dada2f9dd52b1dc63bb04/library/core/src/panicking.rs:297:5
4: <image::codecs::png::PngDecoder<R> as image::image::ImageDecoder>::read_image
at /Users/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/image-0.24.9/src/codecs/png.rs:271:9
5: deno_canvas::op_image_decode_png::op_image_decode_png::call
at ./ext/canvas/lib.rs:135:3
6: deno_canvas::op_image_decode_png::op_image_decode_png::slow_function_impl
at ./ext/canvas/lib.rs:118:1
7: deno_canvas::op_image_decode_png::op_image_decode_png::v8_fn_ptr
at ./ext/canvas/lib.rs:118:1
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. |
hm, that is concerning, that should be working |
Hi @crowlKats, this PR would fix only the bug currently.
|
I think it's better to merge this PR first. Now this PR make the RGBA PNG Blob works fine. Adding other more formats would bring more implementation details and unit tests, which is not just a "fix". |
I agree with @chirsz-ever; lets land this and continue work via follow-ups |
fixes #22649