Hello
I would like to process images in resin server : load, resize, save.

I tried with java.awt.Toolkit -> it launches a GUI thread and seems to 
work asynchroneously (with the image observer)

I tried with javax.imageio.ImageIO -> it launches a GUI thread but worked

I tried with javax.media.jai.JAI -> it launches a GUI thread but worked

I need someting very light, quick and safe, what do you suggest ?
I use java 1.5 on macosx and linux intel.
The test code is here : thanks for any information

import java.awt.Image;
import java.awt.Toolkit;
import java.io.File;

import javax.imageio.ImageIO;
import javax.media.jai.JAI;
import javax.media.jai.PlanarImage;
public class test
{

   public static void main(String[] args)
   {
     if (false)
     {
       System.out.println("Test Image Resizing with AwtToolkit");
       Image img=Toolkit.getDefaultToolkit().getImage("im.jpg");
       if (img!=null)
       {
         int iw = img.getWidth(null);
         int ih = img.getHeight(null);
         System.out.println("source size="+iw+"x"+ih);
       }
     }
     if (true)
     {
       System.out.println("Test Image Resizing with imageio");
       try
       {
         Image img=ImageIO.read(new File("im.jpg"));
         int iw = img.getWidth(null);
         int ih = img.getHeight(null);
         System.out.println("source size="+iw+"x"+ih);
       }catch(Exception ex){ex.printStackTrace();}
     }
     if (false)
     {
       System.out.println("Test Image Resizing with JAI");
       PlanarImage img= JAI.create("fileload","im.jpg");
       if (img!=null)
       {
         int iw = img.getWidth();
         int ih = img.getHeight();
         System.out.println("source size="+iw+"x"+ih);
       }
     }
   }

}

-- 
Riccardo Cohen
Architecte du Logiciel
http://www.architectedulogiciel.fr
+33 (0)6.09.83.64.49



_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to