All of the images below are resampled on request from this original image file
and served through Amazon CloudFront CDN.
It's pretty simple. We setup a Cloudfront Distribution for you that points to our servers as the origin. You upload images to your S3 bucket. When you request your images from Cloudfront, we pull them from S3, resize them on the fly and return them to Cloudfront. You get all the benefits of dynamically sized images and a CDN! We told you it was awesome!
Request URIs are composed of two main parts; 'Image Path' & 'Commands'. These parts are separated by a dollar sign "$".
http://demo.cf.cdnimag.es/size:150x120/$/teamcoco.gif
The relative path to the image you'd like to manipulate. The path should be relative to the bucket you're using. Remember not to include the bucket in the path.
demo/teamcoco.gif
Name or Alias of the S3 bucket the 'Image Path' is relative to
Example: bucket:{bucketNameOrAlias}
MD5 hash of a concatenated string containing the Request URI (excluding the sig: command) and your cdnimag.es API Secret
Example: sig:{md5Hash}
Generating Signature: md5($secret.$uri);
A list of image manipulation commands
Example: size:10x10/scale:min
Width & Height of the resulting image. Can not be used with "Percent" command.
Example: size:100x100
Size of the image as a percentage of the original. Can not be used with "Size" command.
Example: percent:50
Scale then crop the image to the given size. [Default: false]
Example: frame:true
Crop the image to the given size or percent. [Default: false]
Example: crop:true
Resample the image to the given size or percent. Values: max = Scale to max size / min = Scale min proportional size [Default: Max]
Example: scale:min
The vertical pixel or anchor position of the resulting image. Values: pixels, top, bottom, center. [Default: center]
Example: valign:top
The horizantal pixel or anchor position of the resulting image. Values: top, bottom, left, right, center. [Default: center]
Example: valign:top
Reflect the source image. This will double the height of the image. Use bg: and opacity: to set background color and relection opacity. [Default: false]
Example: reflection:false
The background hex value (excluding the hash '#'). Only available when using reflection:
Example: bg:fff
Image opacity value (float). Only available when using reflection:
Example: opacity:.4
The format of the resulting image. Values: jpeg, gif, png. [Default: original image format]
Example: output:png
Rotate the image the give number of degrees. Will be processed after all other commands. Resulting image may not conform to size: command
Example: rotate:90
api.cdnimag.es allows you to upload, retrieve and delete images from account
URL: http://api.cdnimag.es/v1/$domain/$method/$imagePath
All requests to the API must include your API Key and a request signature as HTTP Headers.
X-CdnImages-Key & X-CdnImages-Sig
To generate request signature, combine your API Key, request URL and paramater string
md5($secret.$url.$parameters);
Post (upload) an image to your account
URL: http://api.cdnimag.es/$domain/image/$path
Example: http://api.cdnimag.es/demo.cdnimag.es/image/test/image/img.jpg
HTTP Method: POST
Parameters:
data = base64 encode string with image data