Skip to content

Commit

Permalink
Remove preview image
Browse files Browse the repository at this point in the history
  • Loading branch information
bluecraank committed Mar 13, 2024
1 parent ac109f8 commit d1c8f62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions app/Console/Commands/PresentationProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,12 @@ public function processPdf($presentation)
$imagename = $random . '-' . $i . '.jpg';
$pdf->setResolution(300);

$pdf->setPage($i)->saveImage(public_path('data/presentations/' . $presentation->id . '/' . $imagename));
$resizeImage = \Intervention\Image\Facades\Image::make(public_path('data/presentations/' . $presentation->id . '/' . $imagename))
->resize(1920, 1080)
->save(public_path('data/presentations/' . $presentation->id . '/' . $imagename));
// $pdf->setPage($i)->saveImage(storage_path('app/public/presentations/' . $presentation->id . '/orig-' . $imagename));
$imageData = $pdf->setPage($i)->getImageData(storage_path('app/public/presentations/' . $presentation->id . '/orig-' . $imagename));

$pdf->setPage($i)->saveImage(public_path('data/presentations/' . $presentation->id . '/preview-' . $imagename));
$resizeImage = \Intervention\Image\Facades\Image::make(public_path('data/presentations/' . $presentation->id . '/preview-' . $imagename))
->resize(1920, 1080)
->save(public_path('data/presentations/' . $presentation->id . '/preview-' . $imagename));
$resizeImage = \Intervention\Image\Facades\Image::make($imageData);
$resizeImage->resize(1920, 1080)
->save(public_path('data/presentations/' . $presentation->id . '/' . $imagename));

Slide::updateOrCreate([
'presentation_id' => $presentation->id,
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Slide.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function publicpreviewpath() {
$name = pathinfo($this->name_on_disk, PATHINFO_FILENAME);
$extension = pathinfo($this->name_on_disk, PATHINFO_EXTENSION);
$name = $name . '.jpg';
return asset('data/presentations/' . $this->presentation_id . '/preview-' . $name);
return asset('data/presentations/' . $this->presentation_id . '/' . $name);
}

public function getPublicpathAttribute() {
Expand Down

0 comments on commit d1c8f62

Please sign in to comment.