title: How can I get image parameters from Sitecore MediaItem?
body: <p>I need to read image parameters (source, width, height) in controller when I'm building json feed.</p>
  
  <p>I made all the steps from <a href="https://stackoverflow.com/questions/14766428/how-can-i-make-sitecore-showing-an-image-or-other-resources">this question</a>. But suggested method allows you to get image tag using View Helper, and only inside view context. Since I can't (and really don't want to, as it's really bad practice) create HTMLHelper in Controller I can't generate it there.</p>
  
  <p><a href="https://stackoverflow.com/questions/3835050/how-do-i-render-a-media-library-item-by-itself">This method</a> gives me only path to *.ashx, no matter what I set in my web.config file. So I have this *.ashx URL (<code>/~/media/5EE32493443547ED8DB0B26166209C85.ashx</code>) but I can't take advantage on it and generate normal *.jpg URL, which is <code>/~/media/001FC62786B044F5888640C7164ED72F.JPG</code>.</p>
  
  <p>*.ashx URL has ID in it (<code>5EE32493-4435-47ED-8DB0-B26166209C85</code>), but *.jpg doesn't...</p>
  
  <p>Also when I paste *.ashx URL into browser, server responds with exception that resource couldn't be found.</p>