file view( type, width, height, max_width, max_height, min_width, min_height, aspect_ratio, true_size, no_child_fallback )

Description:

Retrieve a view of this asset's image resource.

Parameters:

type

Optional type of view to retrieve. Value may be one of:

  • image (default)
  • preview
  • landscape
width

Desired width in pixels. The returned view will be exactly this width unless it is further modified with min_* or max_* options.

height

Desired height in pixels. The returned view will be exactly this height unless it is further modified with min_* or max_* options. This parameter is ignored when 'width' is defined.

max_width

Maximum width in pixels. The returned view will have a width equal to or less than this value.

max_height

Maximum height in pixels. The returned view will have a height equal to or less than this value.

min_width

Minimum width in pixels. The returned view will have a width equal to or greater than this value.

min_height

Minimum height in pixels. The returned view will have a height equal to or greater than this value.

aspect_ratio

An aspect ratio to crop the returned view to. May be specified as integer width and height ratios separated by a colon (ex: '16:9'), or the name of another view to match the aspect ratio of (ex: 'hires').

true_size

In some circumstances the dimensions of the image resource delivered to the browser may not match those of the requested view. Pass true to this parameter to be returned a view with dimensions exactly equal to the delivered resource.

no_child_fallback

Pass true to prevent fallback to the primary child when the requested view is not found in this asset. Only applicable to the preview view type.

Return:

A file object representing the requested view, or null if no view could be created.