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(rgba): Handle rgba to rgb conversion based on length #220

Merged
merged 2 commits into from
Sep 16, 2022

Conversation

wayfarer3130
Copy link
Collaborator

This is a work around for the rgba flag not being set correctly and when we have rgba data but need rgb.

@netlify
Copy link

netlify bot commented Sep 16, 2022

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit bcbd14c
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/632495880de50f000877ca77
😎 Deploy Preview https://deploy-preview-220--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 settings.

@@ -1341,7 +1341,10 @@ class StackViewport extends Viewport implements IStackViewport {
const scalars = this._imageData.getPointData().getScalars();
const scalarData = scalars.getData() as Uint8Array | Float32Array;

if (image.rgba) {
if (image.rgba || pixelData.length * 3 == scalarData.byteLength * 4) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a work around for now

@sedghi sedghi changed the title fix(StackViewport):Handle rgba to rgb conversion based on length fix(rgba): Handle rgba to rgb conversion based on length Sep 16, 2022
@sedghi sedghi merged commit d56dd8a into main Sep 16, 2022
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