mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-01-04 03:49:28 +02:00
Fixing photo metadata error
This commit is contained in:
parent
7a4a813b31
commit
c16b5c40a5
@ -182,8 +182,8 @@ export class DiskMangerWorker {
|
|||||||
return new Promise<PhotoMetadata>((resolve, reject) => {
|
return new Promise<PhotoMetadata>((resolve, reject) => {
|
||||||
const fd = fs.openSync(fullPath, 'r');
|
const fd = fs.openSync(fullPath, 'r');
|
||||||
|
|
||||||
const data = Buffer.allocUnsafe(65535);
|
const data = Buffer.allocUnsafe(Config.Server.photoMetadataSize);
|
||||||
fs.read(fd, data, 0, 65535, 0, (err) => {
|
fs.read(fd, data, 0, Config.Server.photoMetadataSize, 0, (err) => {
|
||||||
// fs.readFile(fullPath, (err, data) => {
|
// fs.readFile(fullPath, (err, data) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
fs.closeSync(fd);
|
fs.closeSync(fd);
|
||||||
@ -234,7 +234,7 @@ export class DiskMangerWorker {
|
|||||||
metadata.orientation = exif.tags.Orientation;
|
metadata.orientation = exif.tags.Orientation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(exif);
|
||||||
if (exif.imageSize) {
|
if (exif.imageSize) {
|
||||||
metadata.size = <MediaDimension>{width: exif.imageSize.width, height: exif.imageSize.height};
|
metadata.size = <MediaDimension>{width: exif.imageSize.width, height: exif.imageSize.height};
|
||||||
} else if (exif.tags.RelatedImageWidth && exif.tags.RelatedImageHeight) {
|
} else if (exif.tags.RelatedImageWidth && exif.tags.RelatedImageHeight) {
|
||||||
|
@ -65,6 +65,7 @@ export interface ServerConfig {
|
|||||||
sharing: SharingConfig;
|
sharing: SharingConfig;
|
||||||
sessionTimeout: number;
|
sessionTimeout: number;
|
||||||
indexing: IndexingConfig;
|
indexing: IndexingConfig;
|
||||||
|
photoMetadataSize:number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IPrivateConfig {
|
export interface IPrivateConfig {
|
||||||
|
@ -17,6 +17,7 @@ export class PrivateConfigClass extends PublicConfigClass implements IPrivateCon
|
|||||||
qualityPriority: true
|
qualityPriority: true
|
||||||
},
|
},
|
||||||
sessionTimeout: 1000 * 60 * 60 * 24 * 7,
|
sessionTimeout: 1000 * 60 * 60 * 24 * 7,
|
||||||
|
photoMetadataSize: 512 * 1024,
|
||||||
database: {
|
database: {
|
||||||
type: DatabaseType.sqlite,
|
type: DatabaseType.sqlite,
|
||||||
mysql: {
|
mysql: {
|
||||||
|
Loading…
Reference in New Issue
Block a user