File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes How to get format / mime type (eg. PNG, JPG) of a buffered image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to get format / mime type (eg. PNG, JPG) of a buffered image" Watch "How to get format / mime type (eg. PNG, JPG) of a buffered image" New topic
Author

How to get format / mime type (eg. PNG, JPG) of a buffered image

Rohit Kumar
Ranch Hand

Joined: Sep 20, 2007
Posts: 53
Is it possible to get format or mime type (eg. PNG or JPG) of a buffered image?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19759
    
  20

No. The simple reason is, a BufferedImage is detached from stuff like file types and mime types. It's in memory, and that's it.

You can get the mime type of files or streams though. Check out this link.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4658
    
    5

Just another cross poster.
http://forums.sun.com/thread.jspa?threadID=5354932
http://forums.sun.com/thread.jspa?threadID=5354933


luck, db
There are no new questions, but there may be new answers.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19759
    
  20

Please Be Forthright When Cross Posting To Other Sites.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get format / mime type (eg. PNG, JPG) of a buffered image