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

How can I get the height and width of uploaded images? #62

Closed
jdmswong opened this issue Mar 25, 2016 · 1 comment
Closed

How can I get the height and width of uploaded images? #62

jdmswong opened this issue Mar 25, 2016 · 1 comment

Comments

@jdmswong
Copy link
Contributor

This code prints the image's width and height only after a timeout.

                    onUploaded: function (error, fileRef) {

                        var img = new Image;
                        img.src = Blaze._globalHelpers['fileURL'](fileRef);
                        setTimeout(function () {
                            console.log("5 sec delay:", img.height, " x ", img.width);
                        }, 5000);
                        console.log("First try: ", img.height, " x ", img.width);

Is there a way to get this data without using a timeout?

@jdmswong
Copy link
Contributor Author

http://stackoverflow.com/questions/5633264/javascript-get-image-dimensions

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

1 participant