diff --git a/.github/workflows/cluster-faces-test.yml b/.github/workflows/cluster-faces-test.yml index a8bebcf9d..fed18b839 100644 --- a/.github/workflows/cluster-faces-test.yml +++ b/.github/workflows/cluster-faces-test.yml @@ -140,21 +140,21 @@ jobs: id: photos-cache with: path: data/admin/files/ - key: https://cloud.nextcloud.com/s/4JqQdPy3dicQRPr/download/IMDb-Face.zip + key: https://cloud.nextcloud.com/public.php/dav/files/wfDk23DBsXYrd4S/IMDb-Face.zip - name: Upload photos if: steps.photos-cache.outputs.cache-hit != 'true' run: | mkdir -p data/admin/files/ cd data/admin/files - wget https://cloud.nextcloud.com/s/4JqQdPy3dicQRPr/download/IMDb-Face.zip + wget https://cloud.nextcloud.com/public.php/dav/files/wfDk23DBsXYrd4S/IMDb-Face.zip unzip IMDb-Face.zip rm IMDb-Face.zip - uses: actions/cache/save@v3 with: path: data/admin/files/ - key: https://cloud.nextcloud.com/s/4JqQdPy3dicQRPr/download/IMDb-Face.zip + key: https://cloud.nextcloud.com/public.php/dav/files/wfDk23DBsXYrd4S/IMDb-Face.zip - name: Set config run: | @@ -259,7 +259,7 @@ jobs: - name: Download IMDb-Face.csv working-directory: apps/${{ env.APP_NAME }}/tests/res run: | - wget https://cloud.nextcloud.com/s/4JqQdPy3dicQRPr/download/IMDb-Face-csv.zip + wget https://cloud.nextcloud.com/public.php/dav/files/wfDk23DBsXYrd4S/IMDb-Face-csv.zip unzip IMDb-Face-csv.zip rm IMDb-Face-csv.zip diff --git a/composer.json b/composer.json index 079e82898..1a3649f1c 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,7 @@ "ext-json": "*", "ext-pdo": "*", "rubix/ml": "2.x", + "amphp\/parallel": "1.4.x", "bamarni/composer-bin-plugin": "^1.8" }, "autoload": { diff --git a/lib/Classifiers/Classifier.php b/lib/Classifiers/Classifier.php index 823bd61c7..f34dccaab 100644 --- a/lib/Classifiers/Classifier.php +++ b/lib/Classifiers/Classifier.php @@ -323,6 +323,10 @@ public function generatePreviewWithProvider(File $file): string { // Create a temporary file *with the correct extension* $tmpname = $this->tempManager->getTemporaryFile('.jpg'); + if ($tmpname === false) { + throw new \OCA\Recognize\Exception\Exception('Could not create tmpfile'); + } + $tmpfile = fopen($tmpname, 'wb'); if ($tmpfile === false) { @@ -385,6 +389,10 @@ public function generatePreviewWithGD(string $path): string { // Create a temporary file *with the correct extension* $tmpname = $this->tempManager->getTemporaryFile('.jpg'); + if ($tmpname === false) { + throw new \OCA\Recognize\Exception\Exception('Could not create tmpfile'); + } + $use_gd_quality = (int)\OCP\Server::get(IConfig::class)->getSystemValue('recognize.preview.quality', '100'); if (imagejpeg($previewImage, $tmpname, $use_gd_quality) === false) { imagedestroy($image);