anderson wrote:
> Anyone knows how can I get the GIF or JPEG width ?

I have the beginnings of an open-sourced GIF decoder at:

    http://millibits.com/djh/java/

Look at the implementation of readGIFIdentifier and
readGlobalImageDescriptor for a way to determine the image type and the
header info, including the width and height.

There was a discussion about getting similar information out of a JPEG
image header on news:comp.lang.java.programmer recently, though
considerably more complex as JPEGs can have a variable-length header.

A cheaper solution would be to store a simple .txt file with the same
name as all your .jpg and .gif files.  The text file would simply
contain the image width and height which can be read easily by all sorts
of applications.  A simple Unix script and the netpbm utilities could
create these .txt files pretty easily.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to