Skip to content

Commit

Permalink
fix: update puppeteer arguments to fix thumbnail generation
Browse files Browse the repository at this point in the history
  • Loading branch information
alkrauss48 committed Sep 1, 2024
1 parent 5faf622 commit 92aecf7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions app/Jobs/GenerateThumbnail.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,27 @@ public function handle(): void
{
$tempPath = storage_path("temp/{$this->presentation->slug}-{$this->presentation->user->username}.jpg");


$browsershot = Browsershot::url(route('presentations.show', [
'user' => $this->presentation->user->username,
'slug' => $this->presentation->slug,
]))
->waitUntilNetworkIdle()
->windowSize(1200, 630)
->newHeadless()
->setOption('args', ['--disable-web-security'])
->setOption('args', [
'--disable-web-security',
'--disable-gpu',
'--disable-dev-shm-usage',
'--disable-setuid-sandbox',
'--no-first-run',
'--no-sandbox',
'--no-zygote',
'--deterministic-fetch',
'--disable-features=IsolateOrigins',
'--disable-site-isolation-trials',
])
->setScreenshotType('jpeg', 90)
->noSandbox()
->setOption('addStyleTag', json_encode([
'content' => '.slide-view { height: 100vh !important; } '
.'.browsershot-hide { display: none !important; }',
Expand Down

0 comments on commit 92aecf7

Please sign in to comment.