Current time: 10-23-2019, 02:44 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
naturalWidth and naturalHeight of images
10-25-2017, 01:16 AM
Post: #2
RE: naturalWidth and naturalHeight of images
Your syntax may be a bit backwards. naturalWidth and naturalHeight are the dimensions of the image file not as-displayed. The as-displayed resolutions are available in the DOM as simply width and height (though watch out for css pixels vs display pixels).

You also have no way of knowing what the application is going to actually do with the images. i.e. if there are product images that are zoomed when clicked then a larger than display size may actually make sense for the application.

FWIW, the "Image Analysis" link from a given test that goes to Cloudinary does exactly that and checks for resized images (as does Page Speed Insights).
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: naturalWidth and naturalHeight of images - pmeenan - 10-25-2017 01:16 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)