Skip to content

Instantly share code, notes, and snippets.

@aaronshaf
Created September 27, 2012 22:21
Show Gist options
  • Save aaronshaf/3796802 to your computer and use it in GitHub Desktop.
Save aaronshaf/3796802 to your computer and use it in GitHub Desktop.
Transloadit template example - stores original file without colon in prefix
/*
This template works for both image and non-image files. Image thumbnails are given respective step-name prefixes.
Original files are stored with the "original" prefix without the standard, annoying colon.
*/
{
"steps": {
"32x32": {
"use": ":original",
"robot": "/image/resize",
"width": 32,
"height": 32,
"strip": true,
"zoom": false,
"colorspace": "RGB"
},
"64x64": {
"use": ":original",
"robot": "/image/resize",
"width": 64,
"height": 64,
"strip": true,
"zoom": false,
"colorspace": "RGB"
},
"128x128": {
"use": ":original",
"robot": "/image/resize",
"width": 128,
"height": 128,
"strip": true,
"zoom": false,
"colorspace": "RGB"
},
"256x256": {
"use": ":original",
"robot": "/image/resize",
"width": 256,
"height": 256,
"strip": true,
"zoom": false,
"colorspace": "RGB"
},
"512x512": {
"use": ":original",
"robot": "/image/resize",
"width": 512,
"height": 512,
"strip": true,
"zoom": false,
"colorspace": "RGB"
},
"original": {
"use": ":original",
"robot": "/s3/store"
},
"store": {
"use": [
"32x32",
"64x64",
"128x128",
"256x256",
"512x512",
"original"
],
"robot": "/s3/store",
"key": "...",
"secret": "...",
"bucket": "...",
"strip": true,
"path": '${previous_step.name}/${file.url_name}'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment