image-version
Use of the image-version
resource is deprecated.
You should use representation
elements in the
content-type
resource instead, where possible. (In
other words, you should only use
image-version
if you require functionality that
cannot be provided using representation
elements.)
The
Content Engine
can generate different versions of images for use in different contexts:
large versions for use in articles and thumbnails for use for front page
teasers, for example. The image-version
resource
predefines the different image versions that may be generated. The usual
case is that all the versions used in a publication are down-sampled and
possibly compressed from the original image. The image-version resource
therefore has:
-
A single
originalVersion
element that specifies anid
and alabel
for the original images -
A
version
element for each down-sampled image version. These elements also specify anid
and alabel
, plus information regarding the down-sampling operation to be performed, such as the required resolution (maxWidth
andmaxHeight
in pixels), the required format and so on.
Here is an example image-version
resource that
defines two image versions, thumbnail
and
big
.
<imageDef> <originalVersion id="original"> <label>Original</label> </originalVersion> <version id="thumbnail"> <label>Thumbnail</label> <maxWidth pix="75"/> <maxHeight pix="75"/> <fallback operation="skip"/> <format name="jpg" /> </version> <version id="big"> <label>Big</label> <maxWidth pix="200"/> <maxHeight pix="200"/> <fallback operation="skip"/> <format name="jpg" compression="0.75"/> </version> </imageDef>
This resource is now partially superseded by the
representation
element in the
content-type
resource. The representation element
allows you to define variants of an image that have a specified height
and width. Image variants defined using the
representation
element do not currently offer all the
functionality provided by the image-version
resource,
but they give increased "editor control". Representations appear as crop
windows superimposed over the base image in
Content Studio,
which an editor can move around and resize in order to select a specific
area of the image for publication.
For a full, formal description of the image-version
resource format and all the things you can do with it, see
image-versions.