1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-12-29 02:12:25 +02:00

Fixing photo metadata error

This commit is contained in:
Patrik J. Braun 2018-12-04 13:21:45 +01:00
parent 7a4a813b31
commit c16b5c40a5
3 changed files with 5 additions and 3 deletions

View File

@ -182,8 +182,8 @@ export class DiskMangerWorker {
return new Promise<PhotoMetadata>((resolve, reject) => {
const fd = fs.openSync(fullPath, 'r');
const data = Buffer.allocUnsafe(65535);
fs.read(fd, data, 0, 65535, 0, (err) => {
const data = Buffer.allocUnsafe(Config.Server.photoMetadataSize);
fs.read(fd, data, 0, Config.Server.photoMetadataSize, 0, (err) => {
// fs.readFile(fullPath, (err, data) => {
if (err) {
fs.closeSync(fd);
@ -234,7 +234,7 @@ export class DiskMangerWorker {
metadata.orientation = exif.tags.Orientation;
}
console.log(exif);
if (exif.imageSize) {
metadata.size = <MediaDimension>{width: exif.imageSize.width, height: exif.imageSize.height};
} else if (exif.tags.RelatedImageWidth && exif.tags.RelatedImageHeight) {

View File

@ -65,6 +65,7 @@ export interface ServerConfig {
sharing: SharingConfig;
sessionTimeout: number;
indexing: IndexingConfig;
photoMetadataSize:number;
}
export interface IPrivateConfig {

View File

@ -17,6 +17,7 @@ export class PrivateConfigClass extends PublicConfigClass implements IPrivateCon
qualityPriority: true
},
sessionTimeout: 1000 * 60 * 60 * 24 * 7,
photoMetadataSize: 512 * 1024,
database: {
type: DatabaseType.sqlite,
mysql: {