|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.action.CommonResourceAbstractBase
org.alfresco.repo.action.ParameterizedItemAbstractBase
org.alfresco.repo.action.executer.ActionExecuterAbstractBase
org.alfresco.repo.rendition.executer.AbstractRenderingEngine
org.alfresco.repo.rendition.executer.AbstractTransformationRenderingEngine
org.alfresco.repo.rendition.executer.ImageRenderingEngine
public class ImageRenderingEngine
This class is the implementation of the RenditionService
's
"imageRenderingEngine" rendering engine. This action renders a piece of
content in the same MIME type as its source node, having been rescaled as
requested.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.alfresco.repo.rendition.executer.AbstractRenderingEngine |
---|
AbstractRenderingEngine.RenderingContext |
Field Summary | |
---|---|
static java.lang.String |
NAME
|
static java.lang.String |
PARAM_ALLOW_ENLARGEMENT
This optional Boolean flag parameter specifies whether image resizing
should produce an enlarged image, based on the resizing parameters and the size
of the original image. |
static java.lang.String |
PARAM_COMMAND_OPTIONS
This optional String parameter specifies any additional
ImageMagick commands, that the user wishes to add. |
static java.lang.String |
PARAM_CROP_GRAVITY
This optional String parameter determines the 'zero' position
from which offsets are measured and also determines the direction of
offsets. |
static java.lang.String |
PARAM_CROP_HEIGHT
This optional Integer or Float parameter specifies the
height of the image after cropping. |
static java.lang.String |
PARAM_CROP_WIDTH
This optional Integer or Float parameter specifies the
width of the image after cropping. |
static java.lang.String |
PARAM_CROP_X_OFFSET
This optional Integer parameter specifies the horizontal position
of the start point of the area to be cropped. |
static java.lang.String |
PARAM_CROP_Y_OFFSET
This optional Integer parameter specifies the vertical position
of the start point of the area to be cropped. |
static java.lang.String |
PARAM_IS_PERCENT_CROP
This optional Boolean flag parameter specifies how the
PARAM_CROP_HEIGHT and PARAM_CROP_WIDTH parameters are interpreted. |
static java.lang.String |
PARAM_IS_PERCENT_RESIZE
This optional Boolean flag parameter specifies how the
PARAM_RESIZE_HEIGHT and PARAM_RESIZE_WIDTH parameters are interpreted. |
static java.lang.String |
PARAM_MAINTAIN_ASPECT_RATIO
This optional Boolean flag parameter determines whether the
rendered image maintains its original aspect ratio or is stretched to fit
the specified height and width. |
static java.lang.String |
PARAM_RESIZE_HEIGHT
This optional Integer or Float parameter specifies the
height of the image after resizing. |
static java.lang.String |
PARAM_RESIZE_TO_THUMBNAIL
This optional Boolean flag parameter specifies a mode for
dramatically shrinking large images in a performant way.If set to true the rendering process will be more performant
for large images but the rendered image will be of lower quality. |
static java.lang.String |
PARAM_RESIZE_WIDTH
This optional Integer or Float parameter specifies the
width of the image after resizing. |
Fields inherited from class org.alfresco.repo.rendition.executer.AbstractRenderingEngine |
---|
CONTENT_READER_NOT_FOUND_MESSAGE, contentService, mimetypeMap, nodeService, PARAM_ENCODING, PARAM_MIME_TYPE, PARAM_PLACEHOLDER_RESOURCE_PATH, PARAM_RUN_AS, PARAM_SOURCE_CONTENT_PROPERTY, PARAM_TARGET_CONTENT_PROPERTY, PARAM_UPDATE_RENDITIONS_ON_ANY_PROPERTY_CHANGE |
Fields inherited from class org.alfresco.repo.action.executer.ActionExecuterAbstractBase |
---|
actionDefinition, applicableTypes, publicAction |
Fields inherited from class org.alfresco.repo.action.ParameterizedItemAbstractBase |
---|
DISPLAY_LABEL, runtimeActionService |
Fields inherited from class org.alfresco.repo.action.CommonResourceAbstractBase |
---|
name |
Fields inherited from interface org.alfresco.repo.action.executer.ActionExecuter |
---|
PARAM_RESULT |
Constructor Summary | |
---|---|
ImageRenderingEngine()
|
Method Summary | |
---|---|
protected void |
checkParameterValues(Action action)
This method can be overridden by subclasses to provide checking of parameter values. |
protected java.util.Collection |
getParameterDefinitions()
Supplies the list of parameters required by this rendering engine. |
protected java.lang.String |
getTargetMimeType(AbstractRenderingEngine.RenderingContext context)
|
protected TransformationOptions |
getTransformOptions(AbstractRenderingEngine.RenderingContext context)
|
Methods inherited from class org.alfresco.repo.rendition.executer.AbstractTransformationRenderingEngine |
---|
render |
Methods inherited from class org.alfresco.repo.action.executer.ActionExecuterAbstractBase |
---|
execute, getActionDefinition, getIgnoreLock, getQueueName, getTrackStatus, init, setApplicableTypes, setBaseNodeService, setIgnoreLock, setLockService, setPublicAction, setQueueName, setTrackStatus |
Methods inherited from class org.alfresco.repo.action.ParameterizedItemAbstractBase |
---|
checkMandatoryProperties, getAdhocPropertiesAllowed, getDescriptionKey, getParameterDefintions, getTitleKey, setRuntimeActionService, toString |
Methods inherited from class org.alfresco.repo.action.CommonResourceAbstractBase |
---|
setBeanName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NAME
public static final java.lang.String PARAM_RESIZE_WIDTH
Integer
or Float
parameter specifies the
width of the image after resizing. This may be expressed as pixels or it
may represent a percentage of the original image width, depending on the
value of the PARAM_IS_PERCENT_RESIZE parameter.
public static final java.lang.String PARAM_RESIZE_HEIGHT
Integer
or Float
parameter specifies the
height of the image after resizing. This may be expressed as pixels or it
may represent a percentage of the original image width, depending on the
value of the PARAM_IS_PERCENT_RESIZE parameter.
public static final java.lang.String PARAM_IS_PERCENT_RESIZE
Boolean
flag parameter specifies how the
PARAM_RESIZE_HEIGHT and PARAM_RESIZE_WIDTH parameters are interpreted. If
this parameter is set to true
then the rendition height and
width are represented as a percentage of the original image height and
width. If this parameter is set to false
then the rendition
height and width are represented as pixels. This parameter defaults to
false
.
public static final java.lang.String PARAM_MAINTAIN_ASPECT_RATIO
Boolean
flag parameter determines whether the
rendered image maintains its original aspect ratio or is stretched to fit
the specified height and width. true
then the rendered image will
always maintain its aspect ratio and will be resized to best fit within
the given width and height. For example if an image starts at 100x200
pixels and it is resized to 50x50 pixels then the rendered image will
actually be 25x50 pixels. false
then the image will be stretched
or compressed to fit the given height and width, regardless of the
original aspect ratio. false
public static final java.lang.String PARAM_RESIZE_TO_THUMBNAIL
Boolean
flag parameter specifies a mode for
dramatically shrinking large images in a performant way.true
the rendering process will be more performant
for large images but the rendered image will be of lower quality. false
the rendering process will take longer but
the resulting image will usually be of better quality.
public static final java.lang.String PARAM_ALLOW_ENLARGEMENT
Boolean
flag parameter specifies whether image resizing
should produce an enlarged image, based on the resizing parameters and the size
of the original image. If true (the default), images may be enlarged.
If false, resize operations that would enlarge the image will instead produce a copy
of the original image at the same size.
public static final java.lang.String PARAM_CROP_WIDTH
Integer
or Float
parameter specifies the
width of the image after cropping. This may be expressed as pixels or it
may represent a percentage of the original image width, depending on the
value of the PARAM_IS_PERCENT_CROP parameter.
public static final java.lang.String PARAM_CROP_HEIGHT
Integer
or Float
parameter specifies the
height of the image after cropping. This may be expressed as pixels or it
may represent a percentage of the original image width, depending on the
value of the PARAM_IS_PERCENT_CROP parameter.
public static final java.lang.String PARAM_CROP_X_OFFSET
Integer
parameter specifies the horizontal position
of the start point of the area to be cropped. By default this parameter
sets the distance, in pixels, from the left-hand edge of the image to the
start position of the crop area. By default a positive value will shift
the start-position to the right, while a negative value will shift the
start position to the left. Setting the PARAM_CROP_GRAVITY parameter may
change this, however.
public static final java.lang.String PARAM_CROP_Y_OFFSET
Integer
parameter specifies the vertical position
of the start point of the area to be cropped. By default this parameter
sets the distance, in pixels, from the top edge of the image to the start
position of the crop area. By default a positive value will shift the
start-position downwards, while a negative value will shift the start
position upwards. Setting the PARAM_CROP_GRAVITY parameter may change
this, however.
public static final java.lang.String PARAM_CROP_GRAVITY
String
parameter determines the 'zero' position
from which offsets are measured and also determines the direction of
offsets. The allowed values of gravity are the four cardinal points
(North, East, etc.), the four ordinal points (NorhtWest, SouthEast, etc)
and Center. By default NorthWest gravity is used.
If an ordinal gravity is set then the point from which offsets originate will be the appropriate corner. For example, NorthWest gravity would originate at teh top-left corner while SouthWest origin would originate at the bottom-left corner. Cardinal gravity sets the origin at the center of the appropriate edge. Center origin sets the origin at the center of the image.
Gravity also affects the direction of offsets and how the offset position relates to the cropped image. For example, NorthWest gravity sets positive horizontal offset direction to right, positive vertical direction to down and sets the cropped image origin to the top-left corner. Northerly gavities set the positive vertical direction to down. Southerly gavities set teh positive vertical direction to up. Easterly gavities set teh positive horizontal positive direction to left. Westerly gavities set teh positive horizontal positive direction to right.
Some gravity values do not specify a horizontal or a vertical direction explicitly. For example North does not specify a horizontal direction, while Center does not specify either horizontal or vertical direction. In thse cases the positive horizontal offset direction is always right and the positive vertical offset direction is always down.
The gravity also affects how the cropped image relates to the offset position. For example, NorthWest gravity causes the top-left corner of the cropped area to be the offset position, while NorthEast gravity would set the top-right corner of the cropped are to the offset position. When a direction is not explicitly specified then the center of the cropped area is placed at the offset position. For example, with North gravity the horizontal position is unspecified so the cropped area would be horizontally centered on the offset position, but the top edge of the cropped area would be at the offset position. For Center gravity the cropped area will be centered over the offset position both horizontally and vertically.
public static final java.lang.String PARAM_IS_PERCENT_CROP
Boolean
flag parameter specifies how the
PARAM_CROP_HEIGHT and PARAM_CROP_WIDTH parameters are interpreted. If
this parameter is set to true
then the cropped image height and
width are represented as a percentage of the original image height and
width. If this parameter is set to false
then the rendition
height and width are represented as pixels. This parameter defaults to
false
.
public static final java.lang.String PARAM_COMMAND_OPTIONS
String
parameter specifies any additional
ImageMagick commands, that the user wishes to add. These commands are
appended after the various crop and resize options.
Constructor Detail |
---|
public ImageRenderingEngine()
Method Detail |
---|
protected TransformationOptions getTransformOptions(AbstractRenderingEngine.RenderingContext context)
getTransformOptions
in class AbstractTransformationRenderingEngine
protected java.lang.String getTargetMimeType(AbstractRenderingEngine.RenderingContext context)
getTargetMimeType
in class AbstractRenderingEngine
protected void checkParameterValues(Action action)
AbstractRenderingEngine
checkParameterValues
in class AbstractRenderingEngine
protected java.util.Collection getParameterDefinitions()
AbstractRenderingEngine
getParameterDefinitions
in class AbstractRenderingEngine
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |