0

Can I gather an image or video's native resolution in jQuery? I'm going to manipulate it's size later on, but need a reference to it's original res.

I've seen a few tags such as rootElement.height() but no documentation on it.

Thank you!

technopeasant
  • 7,809
  • 31
  • 91
  • 149
  • This is a duplicate of http://stackoverflow.com/questions/318630/get-real-image-width-and-height-with-javascript-in-safari-chrome so your best bet would be to head over there :) – hughes Jun 23 '11 at 18:00
  • Kinda sorta. Saw that question.. the solution doesn't stick when working with cached images and I'll be dealing with videos as well. – technopeasant Jun 23 '11 at 18:27

1 Answers1

0

You mean this? You may need to expand on your original question. If you want video resolution the javascript will be player dependent.

John Kalberer
  • 5,690
  • 1
  • 23
  • 27
  • That looks about right.. But once I manipulate the size of the object .height() will return it's adjusted size, not it's native size. Do you know what I mean? I'm looking to turn the native height and width into variables to use into a function. – technopeasant Jun 23 '11 at 17:53
  • Yeah, you are talking about the actual resolution. What player are you using? – John Kalberer Jun 23 '11 at 18:11
  • HTML5 video with img fallback (no flash), which is why I need to gather the object's original size whether video or image – technopeasant Jun 23 '11 at 18:25