0

How I in AngularJS resize a image preserve the aspect Ratio and fit in some size. If overflow the size crop the image. for example, I trie to change this plug-in in jquery to angular http://www.jqueryscript.net/gallery/Resize-Images-To-Fit-In-A-Container-imgLiquid.html

My result is some function resize de image for example 1024x1024 to best fit, for example 800x600, but if the image does not preserve the aspect ratio. for example if to preserve the aspect ration the image must be 800x800 we will crop the image

Fabio Santos
  • 253
  • 1
  • 4
  • 15
  • Could you do it with a background image and `background-size: cover` ? – Martijn Welker Feb 23 '16 at 09:41
  • Have a look at this: http://stackoverflow.com/questions/1495407/maintain-the-aspect-ratio-of-a-div-with-css – martin Feb 23 '16 at 09:43
  • Yes but doesn't in angularjs.My result is some function resize de image for example 1024x1024 to best fit, for example 800x600, but if the image does not preserve the aspect ratio. for example if to preserve the aspect ration the image must be 800x800 we will crop the image. – Fabio Santos Feb 23 '16 at 09:56

0 Answers0