This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Resizing jpeg in a pure java environment  RSS feed

Thomas HJ Goorden
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ( 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?
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!