Skip to content

Commit

Permalink
Adding face testing for png #99
Browse files Browse the repository at this point in the history
  • Loading branch information
bpatrik committed Sep 13, 2020
1 parent f1d9fa0 commit ffa7840
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
28 changes: 28 additions & 0 deletions test/backend/assets/test_png.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"faces": [
{
"box": {
"height": 18,
"left": 2.5,
"top": 8,
"width": 21
},
"name": "raspberry"
},
{
"box": {
"height": 7,
"left": 13.5,
"top": 0.5,
"width": 9
},
"name": "leaf"
}
]
"fileSize": 4381,
"orientation": 1,
"size": {
"height": 26,
"width": 26
}
}
Binary file modified test/backend/assets/test_png.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 2 additions & 8 deletions test/backend/unit/model/threading/MetaDataLoader.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@ describe('MetadataLoader', () => {
it('should load png', async () => {
const data = await MetadataLoader.loadPhotoMetadata(path.join(__dirname, '/../../../assets/test_png.png'));
delete data.creationDate; // creation time for png not supported
expect(Utils.clone(data)).to.be.deep.equal(Utils.clone({
fileSize: 2155,
orientation: 1,
size: {
height: 26,
width: 26
}
}));
const expected = require(path.join(__dirname, '/../../../assets/test_png.json'));
expect(Utils.clone(data)).to.be.deep.equal(expected);
});

it('should load jpg', async () => {
Expand Down

0 comments on commit ffa7840

Please sign in to comment.