1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

fixing png test

This commit is contained in:
Patrik J. Braun 2018-12-22 01:14:13 +01:00
parent 4e0c8d32a3
commit baecd8e6da
2 changed files with 2 additions and 1 deletions

View File

@ -81,6 +81,7 @@ export class MetadataLoader {
try { try {
const stat = fs.statSync(fullPath); const stat = fs.statSync(fullPath);
console.log(stat);
metadata.fileSize = stat.size; metadata.fileSize = stat.size;
metadata.creationDate = stat.ctime.getTime(); metadata.creationDate = stat.ctime.getTime();
} catch (err) { } catch (err) {

View File

@ -7,8 +7,8 @@ describe('MetadataLoader', () => {
it('should load png', async () => { it('should load png', async () => {
const data = await MetadataLoader.loadPhotoMetadata(path.join(__dirname, '/../../assets/test_png.png')); 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({ expect(Utils.clone(data)).to.be.deep.equal(Utils.clone({
creationDate: 1545435746672,
fileSize: 2155, fileSize: 2155,
orientation: 1, orientation: 1,
size: { size: {