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 boolean
private ImageInputStream
private static final File
private static final boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String[]
buildCommand
(File sipsCommand, File tempFile) private static String
checkErrorMessage
(Process process) private static boolean
convertToPNG
(File tempFile) private static File
dumpToFile
(ImageInputStream stream) private static boolean
existsAndExecutes
(File cmd) (package private) static boolean
read
(int imageIndex, ImageReadParam param) void
setInput
(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()
-