Class SipsJP2Reader
java.lang.Object
com.twelvemonkeys.imageio.plugins.icns.SipsJP2Reader
QuickFix 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
FieldsModifier and TypeFieldDescriptionprivate static final booleanprivate ImageInputStreamprivate static final Fileprivate static final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String[]buildCommand(File sipsCommand, File tempFile) private static StringcheckErrorMessage(Process process) private static booleanconvertToPNG(File tempFile) private static FiledumpToFile(ImageInputStream stream) private static booleanexistsAndExecutes(File cmd) (package private) static booleanread(int imageIndex, ImageReadParam param) voidsetInput(ImageInputStream input)
-
Field Details
-
SIPS_COMMAND
-
SIPS_EXISTS_AND_EXECUTES
private static final boolean SIPS_EXISTS_AND_EXECUTES -
DEBUG
private static final boolean DEBUG -
input
-
-
Constructor Details
-
SipsJP2Reader
SipsJP2Reader()
-
-
Method Details
-
existsAndExecutes
-
read
- Throws:
IOException
-
setInput
-
convertToPNG
- Throws:
IIOException
-
checkErrorMessage
- Throws:
IOException
-
buildCommand
-
dumpToFile
- Throws:
IOException
-
isAvailable
static boolean isAvailable()
-