Link to home
Start Free TrialLog in
Avatar of gujuraja143
gujuraja143

asked on

Converting a Image File

I am farely new with Java.  The question that I had was that I have a jpeg file that I would like to convert it to another format.  

I want to store some metadata in this new file that I am creating with the image there, so basically I want to creat a new file type or a new image file type (hopefully something called .xpg or something similiar).  


.jpg --->  add more metadata --(save as)--> .xpg


Is this possible?

thank you experts.
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ovi
Ovi

The simplest way is to use JAI (Java Advanced Imaging) from Sun. Normally with JAI you load a image and save'it transparently in which supported format you want. Before downloading JAI, take a look at default encoders provided there and see if there is a match to the one you want.
Avatar of gujuraja143

ASKER

Well the other question I had was that I wanted to save the file as a .xpg or another file type, I wanted to make up my own format.  I understand how to convert the .jpg and load it into java, but how would i save it as a different file time.

This file type, I made it up for the application that I am making.   I want it to convert the .jpg and save it as that file type.  This file type is exactly like the .jpg file but it just has more metadata that is stored in that I need for the application.

I realise what you are trying to do.
I supplied you with a reference to existing source code for image encoders to use as a starting poit and a guide for your development.
Should be a simple matter to take one of these and change the format the data is saved to disk.