Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Jun 3, 2020
1 parent 5beacac commit 0248f0c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ sendTo('cameras.0', 'image', {
height: 50, // optional
angle: 90 // optional
}, result => {
const img = 'data:image/jpeg;base64,' + result;
const img = 'data:' + result.contentType + ';base64,' + result.data;
console.log('Show image: ' + img);
});
```
Expand All @@ -38,7 +38,7 @@ This is normal URL request, where all parameters are in URL. Like `http://mycam/
This is URL request for image, where all parameters are in URL, but you can provide the credentials for basic authentication. Like `http://mycam/snapshot.jpg`

## Changelog
### 0.1.2
### 0.1.2 (2020-06-03)
* (bluefox) implemented get image by message

### 0.1.0
Expand Down
2 changes: 1 addition & 1 deletion io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"subscribable": true,
"dependencies": [
{
"js-controller": ">=1.4.2",
"js-controller": ">=3.1.4",
"web": ">=2.0.0"
}
]
Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function processMessage(adapter, obj) {
if (cam && obj.callback) {
getCameraImage(cam, obj.message.width, obj.message.height, obj.message.angle)
.then(data =>
adapter.sendTo(obj.from, obj.command, { data: Buffer.from(data).toString('base64') }, obj.callback))
adapter.sendTo(obj.from, obj.command, { data: Buffer.from(data).toString('base64'), contentType: 'image/jpeg' }, obj.callback))
.catch(e => adapter.sendTo(obj.from, obj.command, { error: e }, obj.callback));
} else {
obj.callback && adapter.sendTo(obj.from, obj.command, { error: 'Name not found' }, obj.callback);
Expand Down

0 comments on commit 0248f0c

Please sign in to comment.