Class SipsJP2Reader
- java.lang.Object
-
- com.twelvemonkeys.imageio.plugins.icns.SipsJP2Reader
-
final class SipsJP2Reader extends java.lang.ObjectQuickFix for OS X (where ICNS are most useful) and JPEG 2000. Dumps the stream to disk and converts using sips command line tool:sips -s format png <temp>. Reads image back using ImageIO and known format (png).- Version:
- $Id: JPEG2000Reader.java,v 1.0 25.11.11 14:17 haraldk Exp$
-
-
Field Summary
Fields Modifier and Type Field Description private static booleanDEBUGprivate javax.imageio.stream.ImageInputStreaminputprivate static java.io.FileSIPS_COMMANDprivate static booleanSIPS_EXISTS_AND_EXECUTES
-
Constructor Summary
Constructors Constructor Description SipsJP2Reader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.String[]buildCommand(java.io.File sipsCommand, java.io.File tempFile)private static java.lang.StringcheckErrorMessage(java.lang.Process process)private static booleanconvertToPNG(java.io.File tempFile)private static java.io.FiledumpToFile(javax.imageio.stream.ImageInputStream stream)private static booleanexistsAndExecutes(java.io.File cmd)(package private) static booleanisAvailable()java.awt.image.BufferedImageread(int imageIndex, javax.imageio.ImageReadParam param)voidsetInput(javax.imageio.stream.ImageInputStream input)
-
-
-
Method Detail
-
existsAndExecutes
private static boolean existsAndExecutes(java.io.File cmd)
-
read
public java.awt.image.BufferedImage read(int imageIndex, javax.imageio.ImageReadParam param) throws java.io.IOException- Throws:
java.io.IOException
-
setInput
public void setInput(javax.imageio.stream.ImageInputStream input)
-
convertToPNG
private static boolean convertToPNG(java.io.File tempFile) throws javax.imageio.IIOException- Throws:
javax.imageio.IIOException
-
checkErrorMessage
private static java.lang.String checkErrorMessage(java.lang.Process process) throws java.io.IOException- Throws:
java.io.IOException
-
buildCommand
private static java.lang.String[] buildCommand(java.io.File sipsCommand, java.io.File tempFile)
-
dumpToFile
private static java.io.File dumpToFile(javax.imageio.stream.ImageInputStream stream) throws java.io.IOException- Throws:
java.io.IOException
-
isAvailable
static boolean isAvailable()
-
-