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

imageDimensions function not return real size of image #1646

Closed
maxinminax opened this issue Aug 10, 2016 · 5 comments
Closed

imageDimensions function not return real size of image #1646

maxinminax opened this issue Aug 10, 2016 · 5 comments
Labels

Comments

@maxinminax
Copy link

As the title, imageDimensions function not return real size of image, I think should replace clientWidth and clientHeight with naturalWidth and naturalHeight

@danialfarid
Copy link
Owner

Can you provide a sample image or steps to reproduce in a jsfiddle?

@dustinsgoodman
Copy link

@danialfarid This one is weird and it's hyper-specific to a computer's hardware/software so it's not reproducible consistently. Basically, in certain cases, the clientWidth or clientHeight properties of the image here are getting an extra pixel. If you see the screenshot below, you can see that the naturalWidth and naturalHeight will return the correct values but the client values are incorrect. We had 2/9 computers in my office experience this bug. Tracked it down to Chrome but couldn't determine what was adding the pixel.

screen shot 2016-09-07 at 10 54 54 am

@ndavis
Copy link

ndavis commented Sep 7, 2016

Watching

@danialfarid
Copy link
Owner

Fixed at 12.2.8

@dustinsgoodman
Copy link

Thank you for the quick fix/response! Wanted to get you a PR but hands are tied.

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

4 participants