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

finish implementing PImage #43

Closed
11 tasks
lmccart opened this issue Aug 25, 2013 · 8 comments
Closed
11 tasks

finish implementing PImage #43

lmccart opened this issue Aug 25, 2013 · 8 comments
Assignees
Labels

Comments

@lmccart
Copy link
Member

lmccart commented Aug 25, 2013

implement:

  • resize()
  • set()
  • mask()
  • filter()
  • copy()
  • blend()
  • save()
  • fix Pimage vs Image
  • tint
  • noTint
  • sort out loadImage vs requestImage (and loadImage (within canvas) not loading from url without a few refreshes)
@ghost ghost assigned lmccart Oct 21, 2013
@lmccart
Copy link
Member Author

lmccart commented Oct 21, 2013

reworking all this to better match processing reference

@lmccart
Copy link
Member Author

lmccart commented Dec 21, 2013

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

@evhan55
Copy link
Contributor

evhan55 commented Jan 2, 2014

I am curious about this and will tackle it along with unit testing once the refactoring work is ready.

@tafsiri
Copy link
Contributor

tafsiri commented Feb 14, 2014

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.

@lmccart
Copy link
Member Author

lmccart commented Mar 1, 2014

@tafsiri does it make sense to close this, as remaining parts are addressed under other issues?

@evhan55
Copy link
Contributor

evhan55 commented Mar 4, 2014

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!

@lmccart lmccart closed this as completed Mar 4, 2014
@tafsiri
Copy link
Contributor

tafsiri commented Mar 5, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants