Hi. I'm trying to create a new image programmatically using the rmmci. My
code looks like this:

Node node = nodeManager.createNode();

node.setStringValue("title", imagePath);
node.setByteValue("handle", imageData.toByteArray());
node.commit();

No complaints when this runs. But when I try to access the image from a JSP,
this shows up:

java.lang.RuntimeException: Only 1, or 3-band byte data may be written.
at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.jav a:145)
at com.sun.media.jai.opimage.EncodeRIF.create(EncodeRIF.java:74)
at javax.media.jai.OperationRegistry.create(OperationRegistry.java:2956)

The image data comes directly from a .jpg file. Somehow I get the impression
that I am not supposed to put that directly in the node. Is there some
conversion step needed first?

Stefan


Reply via email to