• Post Reply Bookmark Topic Watch Topic
  • New Topic

Image JPEG compression  RSS feed

 
Franck Tranchant
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

Does anyone know a good way to compress image files in the JPEG format in Java2 v1.3 ? Build-in package or free API, I don't know where to start...
My goal is to reduce files size before inserting data as Blob in a database.

A tutorial URL or code sample would be great
Thanx
 
Barry Andrews
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The sun package, which is included in the Java SDK, has some JPEG compress/decompress stuff. But note the warning from Sun:

A Java program that directly calls into sun.* packages is not guaranteed to work on all Java-compatible platforms. In fact, such a program is not guaranteed to work even in future versions on the same platform.


I have used these classes in the past to read/write JPEGS with great success.

Barry
 
Franck Tranchant
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Barry, do you mean the com.sun.image.codec.jpeg.* package ?
I'll try to see how to handle it.

Any other proposition ?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to take a look at the Java Media Framework API. (I'm not sure if it does exactly what you want.)
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Other Java APIs forum...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!