Setting Custom URL for Resize & Crop

You can customize the URL format you want to use when optimizing your images on Merlin CDN. By saving the URL format you use in your current structure to the Merlin system, you can continue to use Merlin CDN with full efficiency without the need for any extra development on your part. Setting custom URL formats is an advanced task. Although the added validations prevent you from entering an incorrect URL format in many cases, it may be insufficient in some cases. After you make sure that the format you entered is fully compliant with the rules below, you can start using your custom URL format.

1. In your custom URL format, {width} and {height} are mandatory parameters and {quality} is optional parameter.

a. {width} : Specifies the width of the output image in pixels. Takes positive integer values.
b. {height} : Sets the height of the output image in pixels. Takes positive integer values.
c. {quality} : Determines the quality of the output image, takes values between 1 and 100. 0 means using original quality.

2. Parameters must contain at least one character between each other.

a. /resize/{width}{height}/ → No characters between parameters, not valid.
b. /resize/{width}/{height}{quality} → No characters between the {height} and {quality} parameters, not valid.
c. /resize/{width}/{height}/ → Parameters contain / character between, valid.
d. /resize/{width}X{height}/ → Parameters contain X character between, valid.
e. /resize/width{width}heigth{height}quality{quality}/ → There are characters between the parameters, valid.

3. Apart from parameters, it is necessary to add a separate prefix or suffix for resize and crop operations. Its default value is the /resize and /crop prefixes.

a. /resize/{width}x{height}/ → Valid.
b. /rs/{width}x{height}/ → Valid.
c. /edit/resize/{width}/{height}/ → Valid.
d. /{width}/{height}/resize → Valid.
e. /{width}x{height}/{quality}/resize/→ Valid.
f. /{width}x{height}/ → Invalid.

4. URL formats are case sensitive. /crop and /CROP will be interpreted as two different values.

Default URL Formats:


  • Resize URL format use for /images/main_image.jpg : /resize/300x400/images/main_image.jpg


  • Crop URL format use for /images/main_image.jpg : /crop/300x400/images/main_image.jpg
Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.