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

fix(dicomImageLoader): Error when loading Wadouri JPEG Image #674

Merged
merged 2 commits into from
Jul 3, 2023

Conversation

mmcarvaxd
Copy link
Contributor

@mmcarvaxd mmcarvaxd commented Jul 1, 2023

Context

There is an error in JPEG.js class when tring parsing JPEG image, the object prototype of this class is assigned using constructor.prototype but apparently this assign is not working in Javascript newer versions, the best way to use it is using Object.setPrototypeOf as mdn post MDN Prototype Post.

When I was implementing a wadouri image download, the following error was shown:
Error Image
Line Error Image

Changes & Results

  • Change the way of assign the prototype of the object.

What are the effects of this change?

Testing

  • Using Wadouri Legacy test
  • Download a Wadouri JPEG compressed image
  • The error is shown in console "Uncaught (in promise) TypeError: Cannot assign to read only property 'prototype' of function 'function DedicatedWorkerGlobalScope()"

Checklist

PR

  • My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

Public Documentation Updates

  • The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • "OS: Windows 10
  • "Node version: v16.20.0
  • "Browser: Chrome 83.0.4103.116

@netlify
Copy link

netlify bot commented Jul 1, 2023

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit d482af3
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/64a0491feb8f9a00089038ba
😎 Deploy Preview https://deploy-preview-674--cornerstone-3d-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sedghi
Copy link
Member

sedghi commented Jul 3, 2023

Thanks for the PR, are you correctly using the dynamic codecs? Since those codecs are in JS and not fast at all. You can look at OHIF viewer to see how we copy our WASM codecs to build so that they get dynamically loaded.

Here are new wasm codecs https://github.com/cornerstonejs/codecs

@mmcarvaxd
Copy link
Contributor Author

mmcarvaxd commented Jul 3, 2023

codecs are in JS and not fast at all. You can look at OHIF viewer to see how we copy our WASM codecs to build

I have not seen that codecs, is there any docs how to use it? I will check it later, appreciate it, thanks!

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

Successfully merging this pull request may close these issues.

2 participants