wood burning stoves*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 19656
    
  18

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: 4523
    
    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: 19656
    
  18

Please Be Forthright When Cross Posting To Other Sites.
 
jQuery in Action, 2nd edition
 
subject: How to get format / mime type (eg. PNG, JPG) of a buffered image
 
Similar Threads
Configuring Tomcat 5 on Win2K and Linux
Mistakenly changed web.xml
Java to Display Data from Database
exception with ImageItem
jpa2web with tomcat problem