Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Using Java ImageIO to read embedded thumbnails in JPEG images

Reply
Thread Tools

Using Java ImageIO to read embedded thumbnails in JPEG images

 
 
Enric Tordera
Guest
Posts: n/a
 
      10-13-2006

I'm trying to write some code to read the embedded thumbnails present in
JPEG images from digital cameras. I am using the ImageIO library

This is the code:

---------------------------------------------------
ImageInputStream iis = ImageIO.createImageInputStream(new
FileInputStream(filename));

Iterator readers = ImageIO.getImageReadersByFormatName("jpg");
ImageReader reader = null;
while (readers.hasNext()) {
reader = (ImageReader)readers.next();
if (reader.readerSupportsThumbnails()) {
reader.setInput(iis, true);
System.out.println("NumThumbnails:" + reader.getNumThumbnails(0));
}
}
----------------------------------------------



It always prints "0", so it seems the library can't find any Thumbnail
in the JPEG file, although I'm sure it is there.

Here are the questions:
* May be the embedded thumbnail is in the EXIF information, so ImageIO
does not support it?
* Is there another ImageReader available that fully supports reading
thumbnails?
* Any hint on how to do this?

Thanks in advance for your help.

- Enric
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How does one get the title out of a JPEG using ImageIO? Ben Phillips Java 10 08-15-2008 06:10 AM
reading large jpeg / jpg files error on java imageio read: javax.imageio.IIOException: Unsupported Image Type Davidski Java 0 11-05-2004 09:44 PM
ImageIO, Can I read images upper of 100KByte ? Max Java 1 03-07-2004 12:35 AM
huge jpeg files show as very small thumbnails (canon 300d, JPEG) kl Digital Photography 6 11-12-2003 08:11 PM
javax.imageio.ImageIO.write() failed to find a png writer F C Java 2 10-01-2003 11:47 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57