Skip to content
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

Safari: ArrayBuffers not instanceof ArrayBuffer when passed from another context #1288

Closed
2 tasks done
DesmondHsu opened this issue Jul 30, 2022 · 0 comments
Closed
2 tasks done

Comments

@DesmondHsu
Copy link

What were you trying to do?

Embed PNG to PDF

How did you attempt to do it?

Call embedPng with an ArrayBuffer

What actually happened?

isType throws

TypeError: png must be of type string or Uint8Array or ArrayBuffer, but was actually of type undefined

What did you expect to happen?

Treat ArrayBuffers from another context as valid.

How can we reproduce the issue?

https://gist.github.com/maximerety/92431f6f4cc9ea8f684de8c124469995

This bug is filed to webkit and fixed for future version.

Version

1.17.1

What environment are you running pdf-lib in?

Browser

Checklist

  • My report includes a Short, Self Contained, Correct (Compilable) Example.
  • I have attached all PDFs, images, and other files needed to run my SSCCE.

Additional Notes

Example fix (for related issue Safari: ArrayBuffers are sometimes not instanceof ArrayBuffer): feross/buffer@bcfa52b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant