From 6c458e2dbb5161f54c41a0b16c97b5c259f44325 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Sun, 29 Dec 2019 12:09:08 +0100 Subject: [PATCH] tweeking thumbnail generation sizes fixing thumbnail selection algorithm --- README.md | 2 +- src/common/config/private/PrivateConfigDefaultsClass.ts | 2 +- src/common/config/public/ConfigClass.ts | 2 +- src/frontend/app/ui/gallery/Media.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1bf0aaa0..09cbf3c2 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ To configure it, run `PiGallery2` first to create `config.json` file, then edit The app has a nice UI for settings, you may use that too. Default user: `admin` pass: `admin` -**Note**: First run, you might have file access issues and port 80 issue. +**Note**: First run, you might have file access issues and port 80 issue, see [#115](https://github.com/bpatrik/pigallery2/issues/115). Running `npm start -- --Server-port=8080` will start the app on port 8080 that does not require `root` Adding read/write permissions to all files can solve the file access issue `chmod -R o-w .`, see [#98](https://github.com/bpatrik/pigallery2/issues/98). diff --git a/src/common/config/private/PrivateConfigDefaultsClass.ts b/src/common/config/private/PrivateConfigDefaultsClass.ts index de86f2bb..80ab9dc3 100644 --- a/src/common/config/private/PrivateConfigDefaultsClass.ts +++ b/src/common/config/private/PrivateConfigDefaultsClass.ts @@ -81,7 +81,7 @@ export class PrivateConfigDefaultsClass extends PublicConfigClass implements IPr { name: DefaultsJobs[DefaultsJobs['Thumbnail Generation']], jobName: DefaultsJobs[DefaultsJobs['Thumbnail Generation']], - config: {sizes: [160]}, + config: {sizes: [240]}, trigger: { type: JobTriggerType.after, afterScheduleName: DefaultsJobs[DefaultsJobs.Indexing] diff --git a/src/common/config/public/ConfigClass.ts b/src/common/config/public/ConfigClass.ts index 5c55ee6b..78abffc9 100644 --- a/src/common/config/public/ConfigClass.ts +++ b/src/common/config/public/ConfigClass.ts @@ -135,7 +135,7 @@ export class PublicConfigClass { }, Thumbnail: { concurrentThumbnailGenerations: 1, - thumbnailSizes: [160, 240, 480], + thumbnailSizes: [240, 480], iconSize: 45, personThumbnailSize: 200 } diff --git a/src/frontend/app/ui/gallery/Media.ts b/src/frontend/app/ui/gallery/Media.ts index c2709e65..8f18cd16 100644 --- a/src/frontend/app/ui/gallery/Media.ts +++ b/src/frontend/app/ui/gallery/Media.ts @@ -21,7 +21,7 @@ export class Media extends MediaIcon { } getThumbnailSize() { - const longerEdge = Math.max(this.renderWidth * this.renderHeight); + const longerEdge = Math.max(this.renderWidth, this.renderHeight); return Utils.findClosestinSorted(longerEdge, Media.sortedThumbnailSizes); }