API Documentation


This page describes all the features of the current version: v1 online since 26/Jul/2012


Enry Point

All requests start with http://api.rethumb.com/v1/ and have the following format:

http://api.rethumb.com/v1/<parameter_1>/<value_1>/<url>
http://api.rethumb.com/v1/<parameter_1>/<value_1>/<parameter_2>/<value_2>/<url>

Parameters

The url parameter must be the last and, at least, one more parameter is necessary.


url Mandatory

This specifies the URL of the original image (HTTPS is supported).

Value: URL of the image to process (this paramter doesn't have a name, only value).

http://api.rethumb.com/v1/width/250/http://factor45.org/images/beach.jpg

width Optional

This will create a thumbnail of the given width (image ratio is kept).

Value: width of the thumbnail in pixels.

http://api.rethumb.com/v1/width/250/http://factor45.org/images/beach.jpg

height Optional

This will create a thumbnail of the given height (image ratio is kept).

Value: height of the thumbnail in pixels.

http://api.rethumb.com/v1/height/250/http://factor45.org/images/beach.jpg

square Optional

This will create a centered square thumbnail from the original image, cropping when needed.

Value: width of the thumbnail in pixels (height and width will be equal).

http://api.rethumb.com/v1/square/175/http://factor45.org/images/beach.jpg

Output

HTTP requests to api.rethumb.com always return an image.

The thumbnail have the same MIME Type as the original image (JPG, PNG or GIF).

Execution errors will return a PNG image with a small description and error code 400 (example).


Current Limitations

This service only processes JPG, PNG, GIF and TIFF images.

TIFF images are converted to PNG.

Using width and height at the same time will keep the aspect ratio.

Maximum width or height is 512px.