Tips and best practices for applying rules for Image Transformations in DAM and Cloudimage

Rules allow you to automatically apply image transformations (such as resizing, filtering, or watermarking) based on patterns in the image URL.

By defining URL-based patterns, you can automate image optimization and simplify the way transformations are applied without modifying individual URLs manually.


Configuring Rules in Cloudimage

  1. Open the Cloudimage Admin Panel.
  2. Navigate to Image Settings.
  3. Click Rules.

Below you can see examples of transformation rules configured in the interface.

image.png

Configuring Rules in Filerobot (DAM)

  1. Open the Filerobot Asset Hub.
  2. Click the Settings icon in the top-right corner.
  3. In the left panel, under Optimization, click Delivery.
  4. Open the Rules section.
  5. Click Add Rule to create a new rule.

Filerobot (DAM) supports Regex-based rules, allowing complex URL patterns to be simplified while keeping assets organized and accessible.

For example, you can create a rule matching:

.png

and apply parameters such as:

wat=1&radius=50

This means that whenever the system detects a URL containing .png, the defined transformation parameters will automatically be applied.


Important behavior of Rules

Cloudimage rules use simple string matching.
Regular expressions (Regex) and special characters are currently not supported in Cloudimage.

Rules operate on the part of the URL that appears after the /v7/ segment.

Example URL:

https://token.cloudimg.io/v7/__aliasname__/sampleimage.jpg

The Rules function receives only:

__aliasname__/sampleimage.jpg

Because of this behavior:

  • A rule matching __alias__ will work
  • A rule matching /__alias__ will fail because the slash does not exist in the processed string

For the same reason, please avoid creating rules that match:

  • Your project token
  • CNAME values
  • Keywords such as cloudimg, filerobot, or v7

Avoid overlapping rule names

Do not create rules with similar patterns such as:

_demo_
__demo__

Similar patterns may cause unintended rule matching. For example, a rule designed for _demo_ may also match __demo__.


Rules and Aliases

Aliases are used to shorten or hide parts of the origin URL.

Cloudimage Rules do not evaluate the full origin URL. They only analyze the path after /v7/.

Example:

https://token.cloudimg.io/v7/__alias__/demoimage.jpg

If the alias __alias__ points to:

www.original-domain.com

The rule must match the alias name, not the original domain.


Using Rules with Presets

Rules can also be combined with presets.

For example, you can create a preset that applies a watermark and then use a rule to trigger that preset automatically. This allows you to apply transformations without exposing them in the public image URL.


Need help?

If you encounter any issues while configuring Rules, please contact our Software Engineers and include the following details:
  • Project/Token
  • Short description of the issue
  • Example URLs
  • Screenshots or short video (if available)
  • Steps to reproduce the issue
Was this article helpful?
0 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.