There are times when images need to be used across devices with different size restrictions. Instead of creating multiple image fields for each image size, Agility provides a way for developers to request a specific image size from an image asset in their code.
Agility offers Media URL Based Transcoding which provides the ability for images that are stored in Agility Media to be transformed into thumbnails via a URL request.
To retrieve a thumbnail from your image:
-
Upload an image to Agility Assets:
-
Get the image URL by left-clicking the image and clicking on 'Copy URL' from drawer popup:
-
In for my image the URL returned is:
https://42b6f927-cdn.agilitycms.cloud/cat.jpg
-
To transform the image we have the following parameters available:
- W: Set the width - number
- H: Set the height - number
- C: Perform an action on the image by passing in the number values below:
- 1: scale
- 2: resize and fill white
- 3: crop
- Q: Quality - (1-100) the quality of the image as a percentage of the original asset
Examples
- Set width of thumbnail (scales height automatically according to native ratio)
https://42b6f927-cdn.agilitycms.cloud/cat.jpg?w=200 - Crop image to 200x200
https://42b6f927-cdn.agilitycms.cloud/cat.jpg?w=200&h=200 - Scale image to 200x200 and fill remaining space
https://42b6f927-cdn.agilitycms.cloud/cat.jpg?w=200&h=200&c=2
Supported file types
Media URL Based Transcoding supported the following file types .jpg, jpeg, .png, .gif
Comments
Please sign in to leave a comment.