Skip to content

p5 image() friendly error message needs clarification #2706

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

Closed
4 of 5 tasks
ryanachten opened this issue Mar 15, 2018 · 2 comments
Closed
4 of 5 tasks

p5 image() friendly error message needs clarification #2706

ryanachten opened this issue Mar 15, 2018 · 2 comments

Comments

@ryanachten
Copy link

  • Found a bug

  • Existing feature enhancement

  • New feature request

  • Image

  • Desktop/Laptop

  • p5.js version: 0.6.0

  • Steps to reproduce this:

Am getting the following friendly error message from p5 concerning arguments passed to the p.image() (with p5 in instance mode).

p5.js says: image() was expecting p5.Image|p5.Element for parameter #0 (zero-based index), received p5.Element instead at webpack-internal:///239:103:9. [http://p5js.org/reference/#p5/image]

Message results from calls such as this: p.image(video, p.mouseX-vWidth/2, p.mouseY-vHeight/2, vWidth, vHeight);.
Video in this case is a p5.MediaElement returned from p.createCapture( p.VIDEO ).

It is unclear as to what is required to resolve the issue since the friendly error message says it was 'expecting a p5.Image or p5.Element' and has 'received p5.Element instead' (p5.MediaElement apparently being a subclass of p5.Element).

(NB: Was referred here from the Processing forum)

@Spongman
Copy link
Contributor

i believe this is a dupe of #2576, which was fixed with #2582, but has not yet been released.

can you verify that this is fixed in this build: https://github.com/Spongman/p5.js/releases/tag/untagged-516916da5822156a6263/ ?

@ryanachten
Copy link
Author

@Spongman can verify the friendly error message isn't present when using the unreleased build

@lmccart lmccart closed this as completed Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants