Rules let you invisibly apply image transformations, like resizing, filtering, or watermarking, directly through URLs. By using URL-based patterns, you can automate and streamline image optimization efficiently.
How can you configure them in our DMO and DAM?
In Cloudimage(DMO), you can configure it as :
- Go to Cloudimage Admin Panel
- Click on Image Settings and click on Rules as shown in the screenshot below :
Below you can see a few transformation rules that are set.
In Filerobot(DAM), you can configure it as :
Go to Filerobot Asset Hub.
Click on Settings icon on top right corner as shown in screenshot below.
In the left pane, under Optimization, click on Delivery.
Click on Rules field.
Click on Add Rule to create new rule.
Filerobot (DAM) supports Regex-based rules to ensure that lengthy or complex URLs can be simplified without affecting the organization or accessibility of the assets. You can refer to official docs for more details on it : DAM Documentation.
You can also set a rule like ".png" and add some parameters (like "wat=1&radius=50") to apply. As a result, whenever the system finds a URL containing ".png", the rule will be applied automatically.
The Rules configuration has some specifics that are good to be mentioned:
Rules work on the principle of simple string matching. There are no Regexes, and the Regex syntax and special characters are currently not supported.
The Rules function receives the image URL in a format starting after the "/v7/" part of the URL.
For example:
If the image URL is https://token.cloudimg.io/v7/__aliasname__/sampleimage.jpg,
then the function receives it as "__aliasname__/sampleimage.jpg"
A rule matching the keyword "__alias__" will work, but another rule like "/__alias__" will fail because the slash symbol ("/") at its beginning won't be matched to the URL.
Due to the same technical specifics, please do not assign rules that match your token, CNAME or keywords like "cloudimg", "filerobot" and "v7".-
Please avoid creating rules that overlap names like
_demo_and__demo__. Such similarities can cause unintended results. For example, a rule meant for_demo_might be wrongly applied to__demo__. Aliases are used to hide or shorten parts of the origin URL. In Cloudimage, rules don’t evaluate the entire URLs; they only consider the path after /v7/.
If an image URL contains an alias, the rule must match the alias itself, not the full origin it represents.
For example:
If your image URL is:
https://token.cloudimg.io/v7/__alias__/demoimage.jpg
and __alias__ points to www.original-domain.com,
then the rule should be created for __alias__, not original domain (www.original-domain.com)Rules can also include presets. You can check this article to learn a handy way to hide your watermarks using a combination between a preset and a rule so the watermark to be invisible in image URLs.
You can refer to official docs for more details on rules : Cloudimage(DMO) Docs
Note: Regular expressions (Regex) are not supported in Cloudimage (DMO). However, Regular expressions are supported in DAM while creating rules.
If you have any questions or issues, please feel free to contact our Software Engineers and mention the following details:
Token
Short description of the issue (including URLs, screenshots, short video if available)
Steps to reproduce the issue.
Comments
Please sign in to leave a comment.