dc-delivery-sdk-js
    Preparing search index...

    Class ImageUrlBuilder

    Utility which helps construct URLs to image resources hosted using the Amplience Dynamic Media platform.

    Commonly used transformations can chained together by calling the appropriate function on the builder. Advanced transformations can be used by configuring a transformation template within the Amplience back-office and applying the template to the builder.

    Index

    Constructors

    Methods

    • Format converts the image to the file format specified. The format will be appended to the URL as a file extension.

      https://images.site.com/i/account/image.webp

      Parameters

      • value: ImageFormat

        Images format to use when encoding the output.

      Returns this

    • Height resizes an image to the pixel size provided. If you only provide one axis, the other will be calculated to maintain aspect ratio. Use the scale mode parameter to apply different resize effects like stretch or crop.

      https://images.site.com/i/account/image?h={{value}}

      Parameters

      • value: number

        The new height in pixels.

      Returns this

    • Host configures the hostname to use when building the image URL. By default, the SDK will use the most appropriate hostname based on the SDK configuration.

      https://{{host}}/i/account/image

      Parameters

      • value: string

        Hostname to use instead of the default value.

      Returns this

    • Parameter appends the specified parameter to the query string. This can be used to pass variables into templates.

      https://images.site.com/i/account/image?{{name}}={{value}}

      Parameters

      • name: string
      • value: string

      Returns this

    • Protocol configures what protocol style to use when building the image URL.

      {{protocol}}[:]//images.site.com/i/account/image

      Parameters

      • value: string

        URL protocol, valid values are: http, https and // for protocol relative URLs

      Returns this

    • Quality sets the compression level for the image output

      https://images.site.com/i/account/image?qlt={{value}}

      Parameters

      • value: number

        The quality percentage (0-100)

      Returns this

    • SEO filename allows a custom filename to be used to improve SEO.

      https://images.site.com/i/account/image/{{seoFileName}}

      Parameters

      • value: string

      Returns this

    • Sharpen applies an unsharp mask to the image to refine edges or make an image look more crisp.

      https://images.site.com/i/account/image?unsharp={{radius}},{{sigma}},{{amount}},{{threshold}}

      Parameters

      • radius: number = 0

        The radius of the Gaussian, in pixels, not counting the center pixel.

      • sigma: number = 1

        The standard deviation of the Gaussian, in pixels.

      • amount: number = 1

        The percentage of the difference between the original and the blur image that is added back into the original.

      • threshold: number = 0.05

        The threshold, as a fraction of MaxRGB, needed to apply the difference amount.

      Returns this

    • Template applies a transformation template to the image, which will apply all of the transformation parameters contained in the template to the image.

      https://images.site.com/i/account/image?${{name}}$

      Parameters

      • name: string

        The name of the transformation template previously configured in the Amplience back-office.

      Returns this

    • Width resizes an image to the pixel size provided. If you only provide one axis, the other will be calculated to maintain aspect ratio. Use the scale mode parameter to apply different resize effects like stretch or crop.

      https://images.site.com/i/account/image?w={{value}}

      Parameters

      • value: number

        The new width in pixels.

      Returns this