This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Help in JSP / JSTL Getting Image Width And Height  RSS feed

 
Ranch Hand
Posts: 43
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ranchers I need to compare the height to the width of an img. How can i accomplish this using JSTL? Or simply how can i get the width and height of an image using JSTL?
 
Author and ninkuma
Marshal
Posts: 66684
167
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP and the JSTL will be of no help; image manipulation is not their job. You'll need to use the image manipulation APIs of Java if you want to do this on the server.

What are you actually trying to accomplish?
 
caleb momanyi
Ranch Hand
Posts: 43
Firefox Browser Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to scale an image without distorting its aspect ratio so that i can dispay it in a divide which has fixed height and width. But i managed to do that by not specifying the width and height in the img tag and in my css
[CODE]
myImgDiv img{
max-width: 100%;
max-height: 100%;
}
[CODE
] it works.
 
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!