public class ImageJImageService extends AbstractImageService
AbstractImageService.ResizeCoordsJahiaImageService.ResizeType| Modifier and Type | Method and Description |
|---|---|
boolean |
cropImage(Image i,
File outputFile,
int top,
int left,
int width,
int height)
Crops an image to a specified file using the specified coordinates
Note : due to a bug, the X and Y are reversed, be careful about that !
|
int |
getHeight(Image i)
Retrieves the height in pixels of the specified image
|
Image |
getImage(JCRNodeWrapper node)
Retrieve the image stored in a JCR node
|
static ImageJImageService |
getInstance() |
int |
getWidth(Image i)
Retrieves the width in pixels of the specified image
|
void |
init() |
BufferedImage |
resizeImage(BufferedImage image,
int width,
int height,
JahiaImageService.ResizeType resizeType)
Resize an image using different types of resize algorithms.
|
boolean |
resizeImage(Image i,
File outputFile,
int width,
int height,
JahiaImageService.ResizeType resizeType)
Resize an image using different types of resize algorithms.
|
protected void |
resizeImage(ij.ImagePlus ip,
int width,
int height,
JahiaImageService.ResizeType resizeType) |
boolean |
rotateImage(Image image,
File outputFile,
boolean clockwise)
Rotate an image clockwise or counter clockwise
|
boolean |
rotateImage(Image i,
File outputFile,
double angle)
Rotate an image clockwise or counter clockwise
|
protected static boolean |
save(int type,
ij.ImagePlus ip,
File outputFile) |
createThumb, getResizeCoords, resizeImagepublic void init()
public static ImageJImageService getInstance()
public Image getImage(JCRNodeWrapper node) throws IOException, javax.jcr.RepositoryException
JahiaImageServicenode - the JCR node that contains the image data.IOExceptionjavax.jcr.RepositoryException - in case of JCR-related errorspublic int getHeight(Image i)
JahiaImageServicei - the image for which to retrieve the heightpublic int getWidth(Image i)
JahiaImageServicei - the imagepublic boolean cropImage(Image i, File outputFile, int top, int left, int width, int height) throws IOException
JahiaImageServicei - the image to cropoutputFile - the destination file in which to store the cropped image. The file type
of the original image is conservedtop - the top Y coordinate at which to start the cropleft - the left X coordinate at which to start the cropwidth - the width of the crop regionheight - the height of the crop region.IOExceptionpublic boolean rotateImage(Image image, File outputFile, boolean clockwise) throws IOException
JahiaImageServiceimage - the image to rotateoutputFile - the file in which to store the rotated image, the original image type
is conservedclockwise - if the true, the image is rotated clockwise, otherwise it is rotated
counter clockwiseIOExceptionpublic boolean rotateImage(Image i, File outputFile, double angle) throws IOException
JahiaImageServicei - the image to rotateoutputFile - the file in which to store the rotated image, the original image type
is conservedangle - angle in degrees
counter clockwiseIOExceptionpublic boolean resizeImage(Image i, File outputFile, int width, int height, JahiaImageService.ResizeType resizeType) throws IOException
JahiaImageServicei - the image to resizeoutputFile - the file in which to output the resized imagewidth - the width of the resized imageheight - the height of the resized imageresizeType - the type of resize algorithm to use. Uses a ResizeType enum also available
in this interfaceIOExceptionpublic BufferedImage resizeImage(BufferedImage image, int width, int height, JahiaImageService.ResizeType resizeType) throws IOException
JahiaImageServiceimage - the image to resizewidth - the width of the resized imageheight - the height of the resized imageresizeType - the type of resize algorithm to use. Uses a JahiaImageService.ResizeType enum also available in this interfacenull in case of a failureIOExceptionfor details of the resizingprotected void resizeImage(ij.ImagePlus ip,
int width,
int height,
JahiaImageService.ResizeType resizeType)
protected static boolean save(int type,
ij.ImagePlus ip,
File outputFile)
Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.