Appearance
Uploads
Authorization
Imagizer Cloud
First request an Auth token from https://cloud.imagizer.com/tokens. Then add the token to the Authorization header on the upload request.
Authorization: Bearer {auth_token}On-Premise Imagizer
On-Premise Imagizer does not currently provide an authorization method. Uploads are disabled by default and when enabled can be limited to port 17007.
WARNING
Take care to only open the port on your firewall to trusted IP Addresses.
Upload to a S3 Backend
Uploads write image files through Imagizer into an S3 bucket. Imagizer can optionally preprocess images before storing them on S3. Images are available immediately after upload.
Configuration
Imagizer Cloud
See the Imagizer Cloud Basic Configuration section for information on enabling uploads.
On-Premise Imagizer
See the Uploads configuration section for information on enabling uploads.
Upload
Upon upload, images are written into Imagizer's local cache, preventing Imagizer from fetching origin images later and speeding up any subsequent requests. The image will then be uploaded into the configured S3 bucket.
Perform a multipart/form-data file upload to the intended URL of the image. The image path will be used as the S3 object key.
Example: Upload an image through Imagizer and into an S3 backend.
http
POST /image_path.jpg HTTP/1.1
Content-Type: multipart/form-data;
file=@in-image.jpgbash
curl -F file=@in-image.jpg "http://{host}/image_path.jpg"Delete
Imagizer does not currently support deleting images. You must delete files directly from your S3 Bucket.
Preprocessing
The cache_processed parameter tells Imagizer to preprocess the image before caching and uploading it, so the stored origin image is the modified version. All subsequent requests will use the preprocessed image.
Example: POST an image file, scale the image to 400px width, and then cache the processed image.
The preprocessed image will be cached at /image.jpg.
http
POST /image.jpg HTTP/1.1
Content-Type: multipart/form-data;
file=@in-image.jpg
cache_processed=true
width=400bash
curl -F file=@in-image.jpg "http://{host}/image.jpg"Upload to Imagizer Storage
Imagizer offers built-in image storage free of charge, backed by Amazon S3 for durability. Upload images directly to Imagizer; they are available immediately after upload.
TIP
Available only on Imagizer Cloud.
Configuration
See the Imagizer Cloud Basic Configuration section for information on enabling Imagizer Storage.
Upload
Example: upload an image to Imagizer Storage
http
POST /api/v1/images HTTP/1.1
Authorization: Bearer {auth_token}
Content-Type: multipart/form-data;
file=@in-image.jpgbash
curl -X POST \
-H "Authorization: Bearer {auth_token}" \
-F file=@in-image.jpg \
https://{source}.cloud.imagizer.com/api/v1/images"Example: response
JSON
{
"url":"http:\/\/{source}.cloud.imagizer.com\/{filename}",
"width":{width},
"height":{height}
}Delete
Example: delete an image from Imagizer Storage
http
DELETE {image_url} HTTP/1.1
Authorization: Bearer {auth_token}bash
curl -X DELETE \
-H "Authorization: Bearer {auth_token}" \
{image_url}