Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » ImageIO problem on Mac
ImageIO problem on Mac [message #126082] Tue, 09 September 2003 19:45 Go to next message
Chengdong Li is currently offline Chengdong LiFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Does Eclipse/Mac support java.awt package?
Next Topic:Actions visibility and enablement
Goto Forum:
  


Current Time: Fri Apr 19 03:37:46 GMT 2024

Powered by FUDForum. Page generated in 0.02348 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top