public class ImageBinary extends Object implements javax.jcr.Binary
Binary
class with extra information regarding images: filename, mimetype and
color model. It uses the Sanselan library to figure out the mimetype if none is provided. For SVG images
(which Sanselan does not recognize) the mimetype auto-detection is skipped and the color model is set to UNKNOWN.
Furthermore it converts YCCK and CMYK input into the RGB color model so it can be used by the JPEGImageReader. See
CMS7-5074 for more info.Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
log |
Constructor and Description |
---|
ImageBinary(javax.jcr.Node node,
InputStream stream,
String fileName) |
ImageBinary(javax.jcr.Node parent,
InputStream stream,
String fileName,
String mimeType) |
Modifier and Type | Method and Description |
---|---|
void |
dispose() |
ColorModel |
getColorModel() |
String |
getFileName() |
String |
getMimeType() |
long |
getSize() |
InputStream |
getStream() |
int |
read(byte[] b,
long position) |
String |
toString() |
public ImageBinary(javax.jcr.Node node, InputStream stream, String fileName) throws GalleryException
GalleryException
public ImageBinary(javax.jcr.Node parent, InputStream stream, String fileName, String mimeType) throws GalleryException
GalleryException
public String getMimeType()
public String getFileName()
public ColorModel getColorModel()
public InputStream getStream() throws javax.jcr.RepositoryException
getStream
in interface javax.jcr.Binary
javax.jcr.RepositoryException
public int read(byte[] b, long position) throws IOException, javax.jcr.RepositoryException
read
in interface javax.jcr.Binary
IOException
javax.jcr.RepositoryException
public long getSize() throws javax.jcr.RepositoryException
getSize
in interface javax.jcr.Binary
javax.jcr.RepositoryException
public void dispose()
dispose
in interface javax.jcr.Binary
Copyright © 2007–2017 Hippo B.V. (http://www.onehippo.com). All rights reserved.