Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Loading an Image on a headless (No XWindows) server  RSS feed

Kjell Wilhelmsen
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ...
I'm developing an web application where the user should be able to upload jpg-images. These images should be saved to disk, and there should be generated a thumbnail and a "low-quality" version of the image.
I've created an ImageConverter class to do this, and it works great on my Windows 2000 computer. But when we tried to install this on a Linux server without X-Windows (and they won't install it for me), it won't work. I've rewritten most of the code so that it should work on this "headless" environment, but I'm not able to figure out how to "load" an image in this environemt. I'm using this approach today:

//Create image and load its data
Image img = Toolkit.getDefaultToolkit().getImage(tmp.getPath());
MediaTracker tracker = new MediaTracker (new Container ());
tracker.addImage (img, 0);
try {
tracker.waitForID (0);
} catch (InterruptedException e) {}
but this wont work in an headless enviroment. Does anyone know of another way to "load" an image. I'm not able to use JDK 1.4, and I'm not able to use another AWT implementation (PJA).
Any help appreciated
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!