Comments (8)
reworking all this to better match processing reference
from p5.js.
from p5.js.
In general, PImage needs review and reworking. One issue is canvas tainting by loading outside images, needs more investigation.
Also keep in mind adding option to disable pixel load with flag set:
https://github.com/lmccart/p5.js/issues/92
And check that the pixel stuff works out:
https://github.com/lmccart/p5.js/issues/42
from p5.js.
I am curious about this and will tackle it along with unit testing once the refactoring work is ready.
from p5.js.
An update on the canvas tainting from outside images. It is indeed because of same origin security policy. At the moment I do not see a purely client side solution for arbitraty remote images (indeed such a solution would be an exploit from the perspective of the spec).
Some searching led to https://developer.mozilla.org/en-US/docs/HTML/CORS_Enabled_Image, which suggests how to make this work if the server serves the image with the right headers. I've added the crossOrigin = 'anonymous' flag to the code i'm currently working on and it works for that class of image. Else the image would need to be served from the same domain as the sketch.
from p5.js.
@tafsiri does it make sense to close this, as remaining parts are addressed under other issues?
from p5.js.
Thanks @tafsiri for looking into the cross-domain issue. For servers not serving that header, we should expect the error. I was talking to @lmccart and think this constraint should serve as a good teaching opportunity to bring cross-domain security issues to light for beginners. Basically, the PImage API should come with some documentation about this possible security error, and an explanation of why it exists.
I would vote for closing this issue!
from p5.js.
hey hey (sorry for late reply), yeah i think this could be closed and more specific bugs made. I'll be making one for blur as i have some thoughts on that. And we'll need another one for filter as that is not actually complete (so in a sense PImage is not done and you could choose to keep this open as a tracking bug—maybe just update the checkboxes above). So I could see going either way.
One other note is that tint(), noTint() are not actually part of the PImage api. In Processing it seems to be a state set to the drawing context that applies to image drawing operations. So we would need issues for that, or we could decide to include it in the PImage api.
from p5.js.
Related Issues (20)
- beginClip() is accidentally being applied to framebuffers
- Accessibility Features Proposal - STF 2 HOT 1
- `nf` seems to have wrong prototypes HOT 1
- Missing backtick in documentation for `loadModel` HOT 2
- canvas doesn't load, no error thrown when invalid parameter passed to `textWrap()` HOT 3
- p5.Framebuffer.autoSized() method may be broken HOT 1
- It is possible to integrate a P5.js canvas/sketch in SwiftUI window (using a webview?) HOT 3
- Improve Accessibility of setup() Function Description in Spanish HOT 1
- The constructor of `p5.Table` doesn't handle the optional parameter `rows`
- `p5.prototype.clearStorage` clears all items for the current domain, instead of items set with `storeItem` only HOT 2
- Does the Processing Foundation support students protesting for Palestine? HOT 1
- Unit test suite not running because of visual tests HOT 8
- [p5.js 2.0 RFC Proposal]: Build and test system update
- [p5.js 2.0 RFC Proposal]: Functional core and modular build HOT 2
- [p5.js 2.0 RFC Proposal]: New third party library authoring API
- [p5.js 2.0 RFC Proposal]: Renderer system refactor HOT 6
- [p5.js 2.0 RFC Proposal]: RNG algorithm change HOT 2
- [p5.js 2.0 RFC Proposal]: Color module rewrite HOT 10
- Is the index missing in `setName` from `p5.XML`? HOT 1
- p5.Vector.sub() Reference documentation has a typo in description HOT 2
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 p5.js.