Cloudimage - Documentation

URL sealing

To prevent your customer to remove certain parameters, you can seal them. For example, if you don't want you user to get the image without a watermark or a certain filter, you can use the URL sealing feature. This system is similar to the URL signature feature but it is only sealing the ci_eqs parameters. This method is compatible with the JS responsive plugin.

The signature is calculated as follows:

Signature = sha1('URI' + 'ci_eqs' + 'Salt' )
where URI = original_image_url and ci_eqs = value of the content of ci_eqs query string

The syntax to process an image is:

//token.cloudimg.io/v7/original_image_url?ci_eqs=XXXX&ci_seal=Signature

Because the Salt is a shared secret between you and Cloudimage, only you will be able to calculate the signature of your images.

Contact us to enable the sealing and set up the Salt for your company token.

Examples:

You want to seal the following parameters: wat=1&wat_url=http://sample.li/louis-vuitton-logo-white.png&wat_scale=45&wat_gravity=southwest&wat_pad=15 on you image sample.li/birds.jpg - Then this image will be watermark and user won't be able to remove it.

Step 1 - encode the query string in base64

The following query

base64('wat=1&wat_url=http://sample.li/louis-vuitton-logo-white.png&wat_scale=45&wat_gravity=southwest&wat_pad=15')

becomes

d2F0PTEmd2F0X3VybD1odHRwOi8vc2FtcGxlLmxpL2xvdWlzLXZ1aXR0b24tbG9nby13aGl0ZS5wbmcmd2F0X3NjYWxlPTQ1JndhdF9ncmF2aXR5PXNvdXRod2VzdCZ3YXRfcGFkPTE1

Step 2 - create the signature

Create the signature :

sha1('sample.li/birds.jpg' + 'd2F0PTEmd2F0X3VybD1odHRwOi8vc2FtcGxlLmxpL2xvdWlzLXZ1aXR0b24tbG9nby13aGl0ZS5wbmcmd2F0X3NjYWxlPTQ1JndhdF9ncmF2aXR5PXNvdXRod2VzdCZ3YXRfcGFkPTE1' + 'salt') = a355cce069fbfb18a4c39113067bf626ead2ebab

Step 3 - Third Step:

you can create the url:

https://demoseal.cloudimg.io/v7/sample.li/birds.jpg?ci_eqs=d2F0PTEmd2F0X3VybD1odHRwOi8vc2FtcGxlLmxpL2xvdWlzLXZ1aXR0b24tbG9nby13aGl0ZS5wbmcmd2F0X3NjYWxlPTQ1JndhdF9ncmF2aXR5PXNvdXRod2VzdCZ3YXRfcGFkPTE1&ci_seal=a355cce069fbfb18a4c39113067bf626ead2ebab

Distribution:

You can now add any querystring you want to this url for example:

But you won't be able to remove or change the query in the ci_eqs or alter the ci_eqs