Skip to content

Is there a technique to identify an API that has been trimmed in WASM? #11893

Answered by darenm
darenm asked this question in Q&A
Discussion options

You must be logged in to vote

After working with @jeromelaban , we were able to determine the issue was related to a SkiaSharp API - specifically, a PNG codec was not available after AOT compilation, but was available in debug. Fortunately, I was able to implement a workaround.

During the diagnostics, we enabled EMCC Profiling as detailed here: Profiling WebAssembly applications.

// _loResImage.ImageData is a byte[] containing a PNG

// Failing code
var loResStream = new MemoryStream(_loResImage.ImageData);
// The Decode method had an internal error unable to run the PNG codec
var loResBitmap = SKBitmap.Decode(loResStream);

// Alternate code that runs without error
var loResSkImage = SKImage.FromEncodedData(_loResImage.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@jeromelaban
Comment options

@darenm
Comment options

@jeromelaban
Comment options

@darenm
Comment options

@darenm
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by darenm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants