aspose file tools*
The moose likes JSP and the fly likes Help in JSP / JSTL Getting Image Width And Height Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Help in JSP / JSTL Getting Image Width And Height" Watch "Help in JSP / JSTL Getting Image Width And Height" New topic
Author

Help in JSP / JSTL Getting Image Width And Height

caleb momanyi
Ranch Hand

Joined: Jun 17, 2012
Posts: 43

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?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61661
    
  67

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?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
caleb momanyi
Ranch Hand

Joined: Jun 17, 2012
Posts: 43

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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Help in JSP / JSTL Getting Image Width And Height