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

drawing on a stack, then saving+reopening, can cause an assert message #12

Open
moltenform opened this issue Apr 12, 2018 · 2 comments
Open

Comments

@moltenform
Copy link
Owner

Mentioned by erico on twitter.

I have a stack that displays the symptom but am not sure of the bug that led to the state.
When opening the stack a JavaScript error message appears, saying "length mismatch, expected, got", and then the dimensions.

@oesterle
Copy link

  • Is the file being encoded properly? (Byte Order Mark in saved JSON is for UTF-8.)
  • Are all special characters being escaped?

My hunch is that Base64 encoding of (compressed) image data, using JavaScript's btoa() and atob() would be less fragile, if somewhat larger. This would also help a JSON saved stack file survive editing outside ViperCard.

@moltenform
Copy link
Owner Author

The serialization is coming directly from the browser's JSON.serialize, and so I don't think that is the source of this problem. In the repro stack, the image data is valid and can be decompressed, but just has different dimensions than expected. A serialization problem would result in data that couldn't be decompressed.

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

No branches or pull requests

2 participants