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

add a button to select an image #8

Open
jywarren opened this issue Jul 16, 2017 · 0 comments
Open

add a button to select an image #8

jywarren opened this issue Jul 16, 2017 · 0 comments

Comments

@jywarren
Copy link
Owner

jywarren commented Jul 16, 2017

This would be great in the demo: https://jywarren.github.io/fisheyegl/example/

along with the current version which triggers when you drag in an image.

Code links

The code for that is here:

https://github.com/jywarren/fisheyegl/blob/master/example/main.js#L104-L142

And here's an example of updating based on a file select button:

https://github.com/publiclab/image-sequencer/blob/master/examples/index.html#L196-L205

They're not too dissimilar; we need the handler to respond to both button-based and drag-based file selection. Any help appreciated!

Note that it's not identical -- the current code uses:

    var files = e.dataTransfer.files;

Whereas the example i linked to uses:

          var file = e.target.files[0];

Both use a FileReader() and reader.readAsDataURL(f);

@jywarren jywarren changed the title button to click to select an image to use add a button to select an image Aug 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant