This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ImageIO.write returns false  RSS feed

 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bb turns out to be false in the following code, but a blank image is still created. That behavior confused me enough, but what is getting me now is how to use ImageIO.write to write a tif file to the file system?




I used the code I found here to list available image formats and of course tif is not listed:

jpeg
bmp
wbmp
gif
png
jpg
jpeg
bmp
wbmp
png
jpg
image/png
image/jpeg
image/x-png
image/vnd.wap.wbmp
image/bmp
image/gif
image/png
image/jpeg
image/x-png
image/vnd.wap.wbmp
image/bmp


documentation says ImageIO.write() "Writes an image using an arbitrary ImageWriter that supports the given format to a File."

I don't understand "arbitrary" here. Is there any way to force it to use a specific ImageWriter? or another way to write tif files?

In asking this question, I solved it. By comparing my environment with a previous environment that worked, I found that adding jai_imageio to my classpath fixed the issue. tif is now included in my available image formats. Without jai_imageio.jar, the code still compiles and runs, but it obviously uses a different ImageWriter. jai_imageio has a plugin directory with a class called TIFFImageWriter. I am still confused by how this is set up.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!