From ffa7840626966ad7331f029e1745088dc8fceacd Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Sun, 13 Sep 2020 14:43:03 +0200 Subject: [PATCH] Adding face testing for png #99 --- test/backend/assets/test_png.json | 28 ++++++++++++++++++ test/backend/assets/test_png.png | Bin 2155 -> 4381 bytes .../model/threading/MetaDataLoader.spec.ts | 10 ++----- 3 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 test/backend/assets/test_png.json diff --git a/test/backend/assets/test_png.json b/test/backend/assets/test_png.json new file mode 100644 index 00000000..d42156c2 --- /dev/null +++ b/test/backend/assets/test_png.json @@ -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 + } +} diff --git a/test/backend/assets/test_png.png b/test/backend/assets/test_png.png index d97f3f642cf43b28e8febc2bcd10af8441807028..6e49418e96bdfe105d0d296a41b8e5527ddcbbf6 100644 GIT binary patch delta 2289 zcmbW2-EQ1O6o8dYuC@|XDgs56%5}J)0^4I}f4tW2RtcL3q=ce0qUsfz*kkWd|7B)2 z-l&!Q3Pj5d5?t~GJOo@I@dEG!yae-Odv_Cvs`$e4oO9;PobUYjpZh=S-|w{U{eJc4 z*+%>7k1^;OzTE*@e_+}@(CONrX%4Xa7U)`B1#Azvo?~m(qmSE*!Nz{8tu0<}Jlbk= z@#4n~Q+@olF}g1#+B}I<>QQ!Z!4~hd9&OXp%N$uJh-Ne5qk{{SvK?LS-D*8~cV!Ej z#vI5^iF-rJ(l-t{D-jX6R z2yONhMPVk0!2mK?WaJf2qljd)-1M`=qW%;mkXi&qI7=VUHAj?9a3bQ|QE~DWN-4La zD#!-M9zl@Xeef{JEoCYsYeq2<;eQn4Xv#>&PrlB;CsbHG^kISsGzcsViWuX!6%i_4 z3!^pMnGv{d*ahKkCxA#oo+tV7vGD zSXlE%*0KkEbyEttcNs;a!i)3PgYvCmH~Wey;#6*@*cj6+WCbK>FXGfj`d*NoA?@pF z#xgq1a_y+B%SQV=hLmDob4{Rq@&czpR?sKwH}ME=u z&k~)TeTRIu0&l;B(K@|xj9@sF?qYmRMIg=35FwZAdbQfGJPmmZubnhhZR?%LPNbT+ zX$}cRV#Jgqy&f{E9<fxoa#`3p5a=zT_u01_H=P zKZHK2Scq#>?#0|`j-*U1JsvSId+wlDgW&d+isJ!hf586^%WG7sxlnb1(-SInezWaT zdhCF%TLTkUkkzmfdQ}#cV#(+Z$jWMx+|EqY6_{%8yFcXm|N-@nwpxM8|f$*85o-A8yM;v z8tWQbTA7$w85k%)fs)GU`pPX0)CBpHXx2b7mVGg^Jt)UtcTFyyB9? zyyR3*7h5Huh+bx9ij}jAsiBFvfs>`Nv4NqXtBIwHi>s@nxuLPCsk5=Asio574J;}m zb_zBSBV1C8GRsm^+=}vZC-<`2Og_tMH+dqbuz`Y&eo;!ARgjAtP^o@}6;O3 { 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 () => {