From 7b7e980ddc6631a66efe08c9cdc068ed52c31949 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Fri, 28 Jun 2024 21:00:34 +0200 Subject: [PATCH 1/3] Update build.yml use action instead of docker image for mariadb --- .github/workflows/build.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7cf93eea..1c2d8584 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,21 +17,13 @@ jobs: strategy: matrix: node-version: [18.x] - - services: - mariadb: - image: mariadb:lts - ports: - - 3306 - env: - MYSQL_USER: user - MYSQL_PASSWORD: password - MYSQL_DATABASE: pigallery_test - MYSQL_ROOT_PASSWORD: password - options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 - - steps: + - uses: getong/mariadb-action@v1.11 + with: + mysql database: 'pigallery_test' + mysql root password: 'password' + mysql user: 'user' + mysql password: 'password' - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 From 80787dfc0eb8084eb56ede7ee7c8a97763b3dc1d Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Fri, 28 Jun 2024 22:07:10 +0200 Subject: [PATCH 2/3] Add a bit more check for video check dimension #666 --- src/backend/model/fileaccess/PhotoWorker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/model/fileaccess/PhotoWorker.ts b/src/backend/model/fileaccess/PhotoWorker.ts index afae0daf..fd8b6f59 100644 --- a/src/backend/model/fileaccess/PhotoWorker.ts +++ b/src/backend/model/fileaccess/PhotoWorker.ts @@ -86,8 +86,8 @@ export class VideoRendererFactory { break; } } - if (!width || !height) { - return reject('[FFmpeg] Can not read video dimension'); + if (!width || !height || isNaN(width) || isNaN(height)) { + return reject(`[FFmpeg] Can not read video dimension. Found: ${{width}}x${{height}}`); } const command: FfmpegCommand = ffmpeg(input.mediaPath); const fileName = path.basename(input.outPath); From 39f1484be2439149d44db327f37921f65e3defdd Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Fri, 28 Jun 2024 22:15:56 +0200 Subject: [PATCH 3/3] Fixing ffmpeg dimension reading issue #666 --- src/backend/model/fileaccess/PhotoWorker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/model/fileaccess/PhotoWorker.ts b/src/backend/model/fileaccess/PhotoWorker.ts index fd8b6f59..af136713 100644 --- a/src/backend/model/fileaccess/PhotoWorker.ts +++ b/src/backend/model/fileaccess/PhotoWorker.ts @@ -80,7 +80,7 @@ export class VideoRendererFactory { let width = null; let height = null; for (const stream of data.streams) { - if (stream.width) { + if (stream.width && stream.height && !isNaN(stream.width) && !isNaN(stream.height)) { width = stream.width; height = stream.height; break;