-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
finish implementing PImage #43
Comments
reworking all this to better match processing reference |
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: And check that the pixel stuff works out: |
I am curious about this and will tackle it along with unit testing once the refactoring work is ready. |
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. |
@tafsiri does it make sense to close this, as remaining parts are addressed under other issues? |
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! |
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. |
implement:
The text was updated successfully, but these errors were encountered: