aspose file tools*
The moose likes Java in General and the fly likes Resizing jpeg in a pure java environment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Resizing jpeg in a pure java environment" Watch "Resizing jpeg in a pure java environment" New topic
Author

Resizing jpeg in a pure java environment

Thomas HJ Goorden
Greenhorn

Joined: Nov 29, 2002
Posts: 6
I'm looking for a way to resize jpeg's on a linux server (web-application), without having to use the AWT or similar.
I've gotten this far:
  • The unofficial jpeg codec from Sun can decode and encode BufferedImages. No problem there.
  • The AWT implementation of image resizing relies on native code. Dead end.
  • It is possible to switch over the image to the PJA implementation of AWT (eteks.com). This can then be passed on to JUI (sourceforge), a library that has it's own resizing ops implemented. However, for read/write operations of jpegs, it relies on AWT itself. Dead end.
  • Ok, we've got a JUI image object (JUI format, not really helpfull for encoding), so we need to go back to a "regular" (PJA) image. Done (slight hack, but it works).
  • Problem: this PJA "Image" object does not get written by the encoder, it requires an "ImageBuffer". Ok, create a Graphics object on this Image and draw it to a BufferedImage you say? Nope, PJA itself relies on AWT for creating Graphics.


  • So, I'm stuck. Really, really stuck.
    I've looked at tons of libraries, but none of them are quite right for the job. PJA claims it's a full replacement, but I strongly suspect they are cutting some corners. JUI (sourceforge) is nice, but uses proprietary formats, which kills, plus, it doesn't have it's own JPEG codec, so you can't use it's read/write methods.
    Other have a number of interesting, but completely useless solutions, like going over native library.
    The library from the "AudioVisual Communications Lab" looks interesting, but the code isn't reachable anymore, plus, it doesn't write anyway and doesn't support progressive jpegs (although I'm willing to forgo this last feature at this point).
    Somebody ever had to create thumbnails on a linux machine with no access to an X11 terminal and no administrative rights? (forget all the -Headless stuff, JDK 1.3) Ideas?
    Regards,
    Thomas
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Resizing jpeg in a pure java environment