Imageinfo is a single Java class that examines InputStream and RandomAccessFile objects. It checks whether the stream/file is in one of the supported image file formats and determines image width, height, and color depth. ImageInfo does not depend on the AWT or additional libraries.
| Tags | Utilities multimedia Graphics |
|---|---|
| Licenses | Public Domain |
| Operating Systems | OS Independent |
| Implementation | Java |
Recent releases


Changes: This release fixes a bug that made ImageInfo reject JPEGs generated by Picasa. It fixes a bug when skipping input data on truncated bitstreams accessed via ByteArrayInputStream. There is some code cleanup.


Changes: Support for SWF (Flash) files was removed. A package statement was added.


Changes: This release removes unused fields and methods, adds missing method documentation, makes the class compatible with Java 1.1 again, fixes a bug with detection of progressive (interlaced) GIF files, and changes the compact output delimiter to tab for better integration with cut(1), etc.


Changes: Support was added for recognizing progressive JPEG and interlaced PNG and GIF. A new method, isProgressive(), returns whether ImageInfo has found that an image was stored in more than one pass. The BMP physical resolution is now correctly determined.


Changes: A bug with skipping data in files and streams was fixed. In rare cases, this may have led to less, corrupted, or no retrieved metadata.
- All comments
Recent commentsCan't get it to work with GIF Files
Very happy with JPG (BMP and PNG) files. Can't seem to work/recognize GIF files.
Any idea?
Thanks.
add some package and fixing Boolean.toString
fyi : these were two modifications I had to change
to perform in order for jsp using ImageInfo to compile.
1. add some package - arguable
2. replace Boolean.toString()
1d0
< package net.freshmeat;
1071c1070
< printLine(1, "Progressive: ", ii.isProgressive() + "");
---
> printLine(1, "Progressive: ", Boolean.toString(ii.isProgressive()));
Re: Refactoring
> ImageInfo IS a very handy utility.
>
> Have you ever thought about refactoring
> it so it will be easier to use and
> maintenance? Using factory/builder
> pattern to return a info class; if
> format not supported then return null or
> throw an exception.
ImageInfo has grown quite a bit. It started out as a class to extract width and height from GIF, PNG and JPG. Now it can extract more from more formats, and in order for it to grow even further it would certainly have to be refactored. However, I don't intend to write a 'real' meta data extraction library right now, as useful as that would be. Someone would have to start a new project for that. ImageInfo might be a good basis for such a library.
Marco
Refactoring
ImageInfo IS a very handy utility.
Have you ever thought about refactoring it so it will be easier to use and maintenance? Using factory/builder pattern to return a info class; if format not supported then return null or throw an exception.