Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bifot/vinci-api
A little documentation for working with vinci API.
https://github.com/bifot/vinci-api
api edit photo vinci
Last synced: 14 days ago
JSON representation
A little documentation for working with vinci API.
- Host: GitHub
- URL: https://github.com/bifot/vinci-api
- Owner: bifot
- Created: 2017-05-30T22:16:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-07T23:40:05.000Z (over 7 years ago)
- Last Synced: 2024-12-23T00:04:05.991Z (18 days ago)
- Topics: api, edit, photo, vinci
- Language: JavaScript
- Size: 1.71 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vinci
A little documentation for working with vinci API.
## Usage
Initially, you need to form multipart/form-data with your photo, then send it on http://vinci.camera/preload. After you need to save your results by request http://vinci.camera/process with proxy. In variable `filter` you can set filter what do you need. Some filters available on website http://vinci.camera/list, but here some hided (see `hidden_filters.json`, if you need more filters).
```javascript
const fs = require('fs')
const path = require('path')
const mime = require('mime')
const request = require('request')const proxy = 'https://cors-pmmlabs.rhcloud.com/'
const filter = 1
const data = {
file: {
value: fs.createReadStream('./test/example.jpg'),
options: {
filename: path.basename('./test/example.jpg'),
contentType: mime.lookup('./test/example.jpg')
}
}
}request({
url: 'http://vinci.camera/preload',
method: 'post',
formData: data,
json: true
}, (err, res, body) => {
if (!err && res.statusCode === 200 && body.preload) {
request(`${proxy}http://vinci.camera/process/${body.preload}/${filter}`)
.pipe(fs.createWriteStream('./test/vinci.jpg'))
}
})
```[There's cool example](https://github.com/bifot/vinci-api/tree/master/test).
## License
MIT.