ImageIO problem on Mac [message #126082] |
Tue, 09 September 2003 19:45 |
Chengdong Li Messages: 36 Registered: July 2009 |
Member |
|
|
Hi,
I have an urgent problem about the using javax.imageio.ImageIO on Eclipse:
Here is my machine and java version:
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-39)
cdli% uname -a
Darwin cdli-Computer.local. 6.6 Darwin Kernel Version 6.6: Thu May 1
21:48:54 PDT 2003; root:xnu/xnu-344.34.obj~1/RELEASE_PPC Power Macintosh
powerpc
Eclipse version : 2.1.1
The problem is, when I use java independently, that is I run java on the
terminal for the following program, it works fine:
import javax.imageio.*;
import java.awt.image.BufferedImage;
import java.io.*;
class Main{
public static void main(String[] args){
try{
BufferedImage image=ImageIO.read(new File("doggie.jpg"));
ImageIO.write(image.getSubimage(0,0,100,100), "png", new
File("doggie.png"
));
}catch(Exception e){
e.printStackTrace();
}
}
}
However, when I juse try the same snippet above (the code inside the try
and
catch) inside a plugin, then the Eclipse seems stuck, and never end, the
image could never be loaded.
It seems for me that the javax.imageio.ImageIO.readImage() does not work
under the mac machine. No problem for the file path.
Does Eclipse not support the javax.imageio package? or ImageIO need some
native library which is not loaded?
Can anybody help?
Many thanks
CD. LI
|
|
|
Re: ImageIO problem on Mac [message #127457 is a reply to message #126082] |
Thu, 11 September 2003 14:23 |
Eclipse User |
|
|
|
Originally posted by: Andre_Weinand.oti.com
On 9.9.2003 15:45 Uhr, in article bjlalk$p41$1@eclipse.org, "CD. LI"
<cli4@uky.edu> wrote:
> Hi,
>
> I have an urgent problem about the using javax.imageio.ImageIO on Eclipse:
>
> Here is my machine and java version:
>
> java version "1.4.1_01"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-39)
>
> cdli% uname -a
> Darwin cdli-Computer.local. 6.6 Darwin Kernel Version 6.6: Thu May 1
> 21:48:54 PDT 2003; root:xnu/xnu-344.34.obj~1/RELEASE_PPC Power Macintosh
> powerpc
>
> Eclipse version : 2.1.1
>
> The problem is, when I use java independently, that is I run java on the
> terminal for the following program, it works fine:
>
> import javax.imageio.*;
> import java.awt.image.BufferedImage;
> import java.io.*;
>
> class Main{
> public static void main(String[] args){
> try{
> BufferedImage image=ImageIO.read(new File("doggie.jpg"));
> ImageIO.write(image.getSubimage(0,0,100,100), "png", new
> File("doggie.png"
> ));
> }catch(Exception e){
> e.printStackTrace();
> }
> }
> }
>
> However, when I juse try the same snippet above (the code inside the try
> and
> catch) inside a plugin, then the Eclipse seems stuck, and never end, the
> image could never be loaded.
>
> It seems for me that the javax.imageio.ImageIO.readImage() does not work
> under the mac machine. No problem for the file path.
>
> Does Eclipse not support the javax.imageio package? or ImageIO need some
> native library which is not loaded?
>
> Can anybody help?
>
> Many thanks
>
> CD. LI
>
>
On Mac OS X you can not use AWT and SWT at the same time because both try to
run their own event loops. The result is a deadlock.
--andre
|
|
|
Powered by
FUDForum. Page generated in 0.02348 seconds