Proportionately rescale images in markdown fields
This is an open discussion with no replies, filed under General.
Search
Create an account or sign in to comment.
This is an open discussion with no replies, filed under General.
Create an account or sign in to comment.
Quick Links
Symphony • Open Source XSLT CMS
--with-xsl
)
I’ve been using mediathek a lot recently, the only issue I had was that some content editors didn’t or were unable to resize images themselves. Something all of us deal with at some point.
After they dragged an image into the markdown field, I was unable to change the image height or width. I thought about using Allen’s ninja technique but markdown doesn’t provide image width or height.
As a fix I wrote this little snippet in jQuery which checks the image width or height and rescales it proportionately so that it fits into the correct space. I send the image back through JIT so that it doesn’t bloat the page.
Please feel free to use it and adapt as required.