cnvyr.io is a simple REST API that uses GET parameters to specify the operations to perform, and POST file uploads to provide the assets to work on.
The current v1
end-point is http://srv.cnvyr.io/v1
For example, POSTing a PNG image to the following URL:
http://srv.cnvyr.io/v1?convert=jpeg&c2w=100&opt=1
will first convert the uploaded image to a JPEG, then crop it's width to 100px, and lastly optimize the resulting JPEG (optimize should generally go last).
NOTE: Operations are performed in the order in which they are defined and ordering can be important.
Uploading files is done by using standard POST file uploads. See Uploading Files
for details, but in short, each file should be in a field named files0
, files1
, etc.
See API for details on what operations can be performed.
Here are some curl examples:
curl -F "files0=@cnvyrio.logo.sm.png" "http://srv.cnvyr.io/v1?c2w=50&opt=1" -o test.png
curl -v -F "files0=@css-icon.png" -F "files1=@docx-win-icon.png" -F "files2=@html-icon.png" \ -F "files3=@pdf-icon.png" -F "files4=@pptx-win-icon.png" -F "files5=@text-icon.png" \ -F "files6=@xlsx-win-icon.png" -F "files7=@zip-icon.png" \ "http://srv.cnvyr.io/v1?sprite=gif" -o sprite-sheet.gif
curl -F "files0=@bootstrap.min.css" -F "files1=@jquery-ui-1.10.3.custom.css" \ -F "files2=@site-styles.css" "http://srv.cnvyr.io/v1?min=css" -o bundle.min.css
NOTE: Existing minified CSS is added to the bundle but otherwise untouched.
curl -F "files0=@html5shiv.js" -F "files1=@respond.min.js" -F "files2=@selectivizr.min.js" \ -F "files3=@site-styles.css" "http://srv.cnvyr.io/v1?min=js&gzip=1" -o bundle.js.gz
NOTE: Some Javascript files - especially those already minified - may have syntax errors. Such files are skipped and added to the bundle untouched.
curl -F "files0=@bootstrap.min.css" -F "files1=@site-styles.css" \ "http://srv.cnvyr.io/v1?min=css&gzip=1" -o bundle.min.css.gz
curl -v "http://srv.cnvyr.io/v1?qrencode=Hello%2C+this+is+a+string+with+a+newline%3A%0D%0A%0D%0Aand+some%2B0ther.stuff+to+pl%40y+games%21" -o qr-code.png
NOTE: No files are uploaded and this can be a POST or a GET. The
qrencode
query string parameter contains the
content to encode, which should itself be URL encoded.
NOTE: If you have sample code in your language of choice, please contact us and we'll include it here.
Updated CSS minify backend to preserve CSS's calc() whitespace.
The API has added sprite maker support for generating CSS sprite sheets from multiple images.
Added the info
operation for retrieving image
details such as dimensions and resolution.
The API now supports QR code maker and reader operations.
The online console for dynamic image thumbnail and manipulation is now available.
An online console for CSS & Javascript API operations is now available.
The console displays the API calls it generates to help with debugging.
Uploading Javascript with syntax errors will no longer cause an error.
It will be combined unchanged with the other files.
First public release.
Endpoint: http://srv.cnvyr.io/v1
Need an unrestricted on-premise API with customizations and integration?
Check out the speeder image CDN.