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

Base64 encoded images #52

Closed
andokai opened this issue Jan 29, 2019 · 3 comments
Closed

Base64 encoded images #52

andokai opened this issue Jan 29, 2019 · 3 comments
Labels
enhancement New feature or request medium-priority
Milestone

Comments

@andokai
Copy link

andokai commented Jan 29, 2019

Base64 encoded images currently throw an exception. Can they be supported?

@andokai
Copy link
Author

andokai commented Jan 29, 2019

I was able to work around this by implementing a custom render function

                customRender: (node, children) {
                  if (node is dom.Element) {
                    switch (node.localName) {
                      case "img":
                        Uint8List bytes =
                            base64.decode(node.attributes['src'].split(",")[1]);
                        return Image.memory(bytes);
                    }
                  }
                },

@andokai andokai closed this as completed Jan 29, 2019
@Sub6Resources
Copy link
Owner

I'm going to reopen this because I think base64 images fall under the scope of this project. I'll work on adding them. Thanks for the report!

@Sub6Resources Sub6Resources reopened this Jan 29, 2019
@Sub6Resources Sub6Resources added enhancement New feature or request medium-priority labels Feb 1, 2019
@Sub6Resources Sub6Resources added this to the 1.0.0 milestone Feb 1, 2019
@Sub6Resources Sub6Resources changed the title Base64 enoded images Base64 encoded images Feb 1, 2019
@Sub6Resources
Copy link
Owner

Support for base64 images has been added in version 0.9.3. Thanks @andokai for the issue report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request medium-priority
Projects
None yet
Development

No branches or pull requests

2 participants