Skip to content

Media reference

Background

Set a background color for the image. This is usefully for images with transparency.

Typebackground
ClassEnhavo\Bundle\MediaBundle\Filter\Filter\BackgroundFilter
Optionsformat, color

format

type: integer

Define the output format. That can be [jpg]{.title-ref}, [png]{.title-ref} and [gif]{.title-ref}.

color

type: integer

Set the background color for the image.

Image

The image filter handle cut and resize for images.

Typeimage
ClassEnhavo\Bundle\MediaBundle\Filter\Filter\ImageFilter
Optionswidth, height, max_width, max_height, format, jpeg_quality, png_compression_level, crop_width, crop_height, crop_x, crop_y

width

type: integer

Define the width for the image, the image will be resize exactly to this size. It depends on the height and maxHeight option if the image will scaled.

height

type: integer

Define the height for the image, the image will be resize exactly to this size. It depends on the width and maxWidth option if the image will scaled.

max_width

type: integer

Define the max width for the image, the image will only be resize to the value if the max value is reached.

max_height

type: integer

Define the max height for the image, the image will only be resize to the value if the max value is reached.

mode

type: [string]

The possible values are [inset]{.title-ref} and [outbound]{.title-ref}. The default value is [outbound]{.title-ref}. The mode is only used if width and height are set. If the image need to be scaled and the sizes are not fit, the [inset]{.title-ref} says that the image will be set into the new size and you will see the full picture, that means also that you have spaces on the edges. If you set the value to [outbound]{.title-ref} the picture will be cut on the edges and fit to the size.

format

type: string

Define the output format. That can be [jpg]{.title-ref}, [png]{.title-ref} and [gif]{.title-ref}. If no format is set, the format will be the same as the input image.

jpeg_quality

type: integer

Set the quality if the output format is jpg. The value can be between 1 and 100. The default value is 75.

png_compression_level

type: integer

Set the compression level if the output format is png. The value can be between 1 and 9. The default value is 7.

crop_width

type: integer

Set the width of the crop window.

crop_height

type: integer

Set the height of the crop window.

crop_x

type: integer

Set the x position of the crop window. 0 is the top of the image.

crop_y

type: integer

Set the y position of the crop window. 0 is the left edge of the image.

Image blur

Blur image.

Typeimage_blur
ClassEnhavo\Bundle\MediaBundle\Filter\Filter\ImageBlur

Image compression

Compress an image to optimize size without losing quality.

Typeimage_compression
ClassEnhavo\Bundle\MediaBundle\Filter\Filter\ImageCompressionFilter

Image zoom

Zoom image.

Typeimage_zoom
ClassEnhavo\Bundle\MediaBundle\Filter\Filter\ImageZoomFilter

Parent

Execute all filters from parent filter.

Typeparent
ClassEnhavo\Bundle\MediaBundle\Filter\Filter\ParentFilter

PDF image

Convert a pdf to an image. Mainly used for preview issues.

Typepdf_image
ClassEnhavo\Bundle\MediaBundle\Filter\Filter\PDFImageFilter

Video image

Convert a video to an image. Mainly used for preview issues.

Typevideo_image
ClassEnhavo\Bundle\MediaBundle\Filter\Filter\VideoImageFilter