Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Get Image Width and Height values

Posted on 2008-06-10
3
Medium Priority
?
1,310 Views
Last Modified: 2013-11-24
I am just learning JSP, and I have been trying to get this working all day to no avail.  What I am trying to do is, using an image's path on my physical drive like "C:\myfolder\myimage.jpg", display on a webpage the width and height of the image.  I did not need to manipulate the image, so I thought this might be easy.  If anyone has some working code in JSP to solve this that would be amazing.  I am not picky right now if it is using a scriptlet, tags, or however it can be done  Thanks!
0
Comment
Question by:js_vaughan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 21753910
You can do something like:
BufferedImage bi = javax.imageio.ImageIO.read(new File("C:/myfolder/myimage.jpg"));
int w = bi.getWidth();
int h = bi.getHeight();

Open in new window

0
 
LVL 10

Author Closing Comment

by:js_vaughan
ID: 31465877
I figured it was going to be simple, just wasnt getting it right =P

Thanks!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 21754088
:-)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question