Comments (2)
I suggest making Image.network load the image in the background in the HTML context (the WebGL canvas is running in an HTML context).
By using document.createElement in javascript to create an element and setting the crossOrigin attribute on it, we can load the image into memory behind the scene. Then we load the image onto the canvas from memory without tainting the canvas.
The user experience would be to use Image.network as with other images, and it just works. Enabling CORS on the server will always be required of course.
My knowledge of Flutter Web is limited as of now, but I could present a more concrete solution if I could discuss this with some people well-versed in the Flutter web code and architecture.
Any thoughts on this @yjbanov?
See the following references on CORS images and canvas:
Allowing cross-origin use of images and canvas (MDN)
Using Cross-domain images in WebGL and Chrome 13 (Chromium Blog)
from flutter.
Using Cross-domain images in WebGL and Chrome 13 (Chromium Blog)
After doing some research, I think this could be done in the NetworkImage._loadAsync method in _network_image_web.dart.
from flutter.
Related Issues (20)
- [tool_crash] _TypeError: (#0 PlistParser.getValueFromFile (package:flutter_tools/src/ios/plist_parser.dart:178:24))
- linux-13 lost external connection phone device.
- Flake in image_filter_test due to non-synchronous test addtion
- WidgetsBinding.drawFrame assertion failure: 'debugFrameWasSentToEngine': is not true
- Class function attribute 'call' breaks in web release mode with null values
- win-7 pickups error "get_dimensions(): expected a dict, got None". HOT 1
- [Semantics / Accessibility] TextField is invisible to TalkBack when suffixIcon is a IconButton. HOT 1
- Upgrade all packages to `package:web` version `1.0.0`
- the doctor check crashed
- TextInput.finishAutofillContext() doesn't bring up the system prompt - iOS
- CustomScrollView with the property "scrollDirection: Axis.horizontal" doesn't work in desktop web brower and the mouse
- linux-51 is dead. HOT 1
- Promote camera plugin to 1.0 HOT 3
- Missing `//flutter` in `//testing/scenario_app` causes a crash HOT 2
- FlexibleSpaceBar causing Null check operator used on a null value HOT 1
- kotlin gradle plugin failure only after installing tts in flutter app HOT 4
- Improve fidelity of `CupertinoRadio`
- [rfw] Goldens tests disabled due to blocking flutter->packages roll
- TextField becomes focused on navigator back (pop) action HOT 3
- Flutter GPU has analysis errors that probably (?) were just hidden before
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter.