If i want to save this picture in BMP format, this code create a pic.bmp file with size zero byte and of course i cannot open that .bmp file.
There is the same problem with GIF format. This operation works in PNG, and JPG format.
Does someone have any idea how to change this code?
Thank you in advance for any help you can provide.
Thanks the answer!
Yes.. You are right. Both of you. I tried this code on my home pc. I'm using JSE6u31 on Windows7 and this code works. At my workplace we have to use an older version the Java 1.4 i think on Windows XP.
Is it possible the Java 1.4 cannot make BMP file? If yes, can i add and use any plugin for the solution?
At my workplace we use IBM Rational Application Developer V6.0, JDK 1.4 and as we thought it could be the problem.
I'd like to find the solution. I should to add a plugin to solve my null bmp problem?
One of these could be good? If that isn't what i have to looking for, where should i search? How can i add a bmp plugin into eclipse based RADV6.0?
Thanks in advance.
Joined: Sep 21, 2011
BMP has been supported by ImageIO from the beginning; there is no plugin you could (or need to) add. It's possible that there are bugs in the implementation, especially on earlier JDKs. Instead of working around those bugs from 10 years ago, migrate to a newer JDK, at least Java 6.
Yes Tim, i know you are right about that we should to migrate to JDK 6 or 7 (and of course, i use the 7 version at home), but it is not practicable yet, because i am new at my workplace and i am a simple inferior, therefore i cannot do anything about this. So therefore i should do solve this in the 1.4 version of JDK. Do you know, or somebody know any possibility?
Joined: Sep 21, 2011
There are any number of ways to convert images from one format to another. If you want to do this in Java, check out the ImageJ library.
ed fromhadria wrote:Yes Tim, i know you are right about that we should to migrate to JDK 6 or 7 (and of course, i use the 7 version at home), but it is not practicable yet, because i am new at my workplace and i am a simple inferior, therefore i cannot do anything about this. So therefore i should do solve this in the 1.4 version of JDK.
Hmmm.... I hope that you'll be able to convince your employer someday soon that using Java 1.4 is not a good idea anymore. Java 1.4 and also Java 5 have passed their end-of-life date long ago, which means that Oracle does not provide any security fixes or bugfixes for these versions anymore, unless your company has an expensive contract with Oracle.
See: Java SE EOL Policy. Java 1.4 has not been supported anymore since October 2008 and Java 5 hasn't been supported anymore since October 2009. Even support for Java 6 is going to be dropped in November this year!
Jesper, Pat! As i've said i know you are right! (: I have to do in java, because my coproration uses servlets for our activity.
Well as i see i cannot solve this problem.
Apart from, thank You so much the answers!