-
Bug
-
Resolution: Fixed
-
P3
-
5.0, 6, 6u38
-
b20
-
generic
-
generic
-
Verified
I am creating a buffered image with some 2D graphics and trying to write it as TIFF image using ImageIO. I am calling ImageIO.write(bimg, "tiff", File). This operation should fail since there is no tiff plugin available in ImageIO. This works as expected where write() method returns false.
But I am surprised to see an empty file being created in the location that I have given. Say if my output file is output.tif, I see a '0' byte file being created by the write() method. This is misleading since it appears as if write() operation is doing some writing and it failed for some reasons. We should not be creating any empty file when the format is not supported.
This is reproducible on Tiger as well as Mustang. This is reproducible on all platforms.
I have attached a sample test. Execute the sample test. If you see an 'output.tif' file in the directory where you executed this test, the bug is reproduced.
But I am surprised to see an empty file being created in the location that I have given. Say if my output file is output.tif, I see a '0' byte file being created by the write() method. This is misleading since it appears as if write() operation is doing some writing and it failed for some reasons. We should not be creating any empty file when the format is not supported.
This is reproducible on Tiger as well as Mustang. This is reproducible on all platforms.
I have attached a sample test. Execute the sample test. If you see an 'output.tif' file in the directory where you executed this test, the bug is reproduced.
- relates to
-
JDK-6689352 Clarify ImageIO.write javadoc
-
- Open
-