Jump to content

Get width of specific image


Chris Falkenstein
 Share

Recommended Posts

Hi all,  I created a Hanna Code that allows a client to embed a image.  First they upload an image to the page (using the images field).  Then they use Hanna Code to embed it.  The Hanna Code looks like the following.

[[image file='myimage.jpg' caption="my image" align='center']]

I'd like to set a max-width on the generated HTML img tag.  I need the width of the image.  How can I get it?  So I need a way to get the image width based on the name of the image? Any ideas?   

 

Link to comment
Share on other sites

Under the "Input" tab for the field (in question), you can set the max width and/or max height for uploaded images. 

Screen Shot 2017-08-30 at 3.53.42 PM.png

However, if you are trying to output a max-width property for use with your hanna code, My "solution" might not be what you are looking for.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...