aspose file tools*
The moose likes Struts and the fly likes Not able to create image. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Not able to create image." Watch "Not able to create image." New topic
Author

Not able to create image.

Vijendra Babar
Greenhorn

Joined: Jul 28, 2006
Posts: 18
Hello friend,

Following is my machine environment:
JDK: 1.5
Struts: 2.0
Tomcat: 5.5
OS: Linux

I want to create a thumbnail from image. Entire logic for it is clear. I have runned same application on Windows platform, it is working fine & gives no error.
But of the application is deployed on Linux platform, it throws exception.

Following is the logic:

1. I create a file object with string input containing path.
2. I have taken another varible of BufferedImage
Code :

BufferedImage image = ImageIO.read(imageFile);

While creating this ojbect it gives me Exception as

javax.imageio.IIOException: Can't read input file!

Since file is created, there is not problem in path.
Then why is it giving me exception, instead it gives prefect output on windows platform.

Can any one sort out this problem.
Dom Lassy
Ranch Hand

Joined: May 05, 2006
Posts: 181
What is the string input you are using to create the file object?

You should not use any "/" or "\" characters for the path. You need to use File.separator instead.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Also, make sure that you are not including a drive letter such as "c:\" in your path. There is no such thing as a drive letter in LINUX.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not able to create image.