Skip to content

A self-hosted media server and file management system

chore: pint

aminnausin6b04b68a18e0
diff --git a/app/Services/PreviewGeneratorService.php b/app/Services/PreviewGeneratorService.php
index 4c6943c4..a0f2d6bd 100644
--- a/app/Services/PreviewGeneratorService.php
+++ b/app/Services/PreviewGeneratorService.php
@@ -160,7 +160,6 @@ class PreviewGeneratorService {
Storage::disk('public')->makeDirectory(dirname($relativePath));
$html = view('og-media-preview', $data)->render();
-
$browsershot = Browsershot::html($html)->windowSize(1200, 630)
->deviceScaleFactor(2)
->waitUntilNetworkIdle()->setOption('args', [
@@ -172,6 +171,8 @@ class PreviewGeneratorService {
]);
if (file_exists('/run/current-system/sw/bin/chromium')) {
$browsershot->setChromePath('/run/current-system/sw/bin/chromium');
+ } elseif (file_exists('node_modules/@sparticuz/chromium/bin/chromium')) {
+ $browsershot->setChromePath(base_path('node_modules/@sparticuz/chromium/bin/chromium'));
} elseif ($this->canUseDocker()) {
$browsershot->useDocker();
} elseif (file_exists('/usr/bin/chromium') || file_exists('/usr/bin/chromium-browser')) {