mirror of
https://github.com/bpatrik/pigallery2.git
synced 2024-12-10 11:10:35 +02:00
Merge pull request #275 from kagahd/issue274
#274 use ExifReader 3.15.0 to avoid overwriting Rating by RatingPercent
This commit is contained in:
commit
6249d942c0
25
package-lock.json
generated
25
package-lock.json
generated
@ -8490,9 +8490,9 @@
|
||||
"integrity": "sha1-WKnS1ywCwfbwKg70qRZicrd2CSI="
|
||||
},
|
||||
"exifreader": {
|
||||
"version": "3.14.1",
|
||||
"resolved": "https://registry.npmjs.org/exifreader/-/exifreader-3.14.1.tgz",
|
||||
"integrity": "sha512-SUxpOk39IvFc+KqglisSy42P8nNTrX/8HC6VijSQUzDRBolqa0ps7M8patMWCZ4NKuleLVq6qR41pOvF5ITdKg==",
|
||||
"version": "3.15.0",
|
||||
"resolved": "https://registry.npmjs.org/exifreader/-/exifreader-3.15.0.tgz",
|
||||
"integrity": "sha512-4zv6c6MLUt1V95moV/IHf7fReLTucrkVv8WJCE2fUVxPgqKFG5Au62MJGWh0nGWEAnZ/BhG4CPftyCxQNA26Ug==",
|
||||
"requires": {
|
||||
"xmldom": "^0.1.31"
|
||||
}
|
||||
@ -21524,9 +21524,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"js-yaml": {
|
||||
"version": "3.14.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz",
|
||||
"integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==",
|
||||
"version": "3.14.1",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
|
||||
"integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"argparse": "^1.0.7",
|
||||
@ -21549,18 +21549,19 @@
|
||||
}
|
||||
},
|
||||
"resolve": {
|
||||
"version": "1.17.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
|
||||
"integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
|
||||
"version": "1.20.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
|
||||
"integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-core-module": "^2.2.0",
|
||||
"path-parse": "^1.0.6"
|
||||
}
|
||||
},
|
||||
"tslib": {
|
||||
"version": "1.13.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
|
||||
"integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==",
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@
|
||||
"cookie-session": "2.0.0-rc.1",
|
||||
"csurf": "1.11.0",
|
||||
"ejs": "3.1.6",
|
||||
"exifreader": "3.14.1",
|
||||
"exifreader": "3.15.0",
|
||||
"express": "4.17.1",
|
||||
"express-unless": "0.5.0",
|
||||
"fluent-ffmpeg": "2.1.2",
|
||||
@ -135,7 +135,7 @@
|
||||
"rxjs-compat": "6.6.7",
|
||||
"ts-helpers": "1.1.2",
|
||||
"ts-node": "9.1.1",
|
||||
"tslint": "6.1.3",
|
||||
"tslint": "^6.1.3",
|
||||
"typescript": "4.1.5",
|
||||
"xlf-google-translate": "1.0.0-beta.21",
|
||||
"xml2js": "0.4.23",
|
||||
|
BIN
test/backend/assets/two_ratings.jpg
Normal file
BIN
test/backend/assets/two_ratings.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
18
test/backend/assets/two_ratings.json
Normal file
18
test/backend/assets/two_ratings.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"cameraData": {
|
||||
"ISO": 500,
|
||||
"exposure": 0.01,
|
||||
"fStop": 2.4,
|
||||
"focalLength": 4.32,
|
||||
"make": "samsung",
|
||||
"model": "SM-G975F"
|
||||
},
|
||||
"creationDate": 1619181527000,
|
||||
"fileSize": 4877,
|
||||
"orientation": 1,
|
||||
"rating":3,
|
||||
"size": {
|
||||
"height": 5,
|
||||
"width": 10
|
||||
}
|
||||
}
|
@ -12,7 +12,7 @@ describe('DiskMangerWorker', () => {
|
||||
ProjectPath.ImageFolder = path.join(__dirname, '/../../../assets');
|
||||
const dir = await DiskMangerWorker.scanDirectory('/');
|
||||
// should match the number of media (photo/video) files in the assets folder
|
||||
expect(dir.media.length).to.be.equals(7);
|
||||
expect(dir.media.length).to.be.equals(8);
|
||||
const expected = require(path.join(__dirname, '/../../../assets/test image öüóőúéáű-.,.json'));
|
||||
const i = dir.media.findIndex(m => m.name === 'test image öüóőúéáű-.,.jpg');
|
||||
expect(Utils.clone(dir.media[i].name)).to.be.deep.equal('test image öüóőúéáű-.,.jpg');
|
||||
|
@ -32,6 +32,12 @@ describe('MetadataLoader', () => {
|
||||
expect(Utils.clone(data)).to.be.deep.equal(expected);
|
||||
});
|
||||
|
||||
it('should load Rating and not overwrite its value by RatingPercent', async () => {
|
||||
const data = await MetadataLoader.loadPhotoMetadata(path.join(__dirname, '/../../../assets/two_ratings.jpg'));
|
||||
const expected = require(path.join(__dirname, '/../../../assets/two_ratings.json'));
|
||||
expect(Utils.clone(data)).to.be.deep.equal(expected);
|
||||
});
|
||||
|
||||
it('should load jpg 2', async () => {
|
||||
const data = await MetadataLoader.loadPhotoMetadata(path.join(__dirname, '/../../../assets/old_photo.jpg'));
|
||||
const expected = require(path.join(__dirname, '/../../../assets/old_photo.json'));
|
||||
|
Loading…
Reference in New Issue
Block a user