fix overlapping pages on PDF thumbnail generation

This commit is contained in:
2024-05-04 14:42:23 +10:00
parent 3358cf8dea
commit 6a76dacdae
2 changed files with 13 additions and 1 deletions

View File

@@ -233,6 +233,13 @@ class MediaController extends Controller
if(!$exists) {
$media->generateVariants(false);
} else {
// find media with the same hash that also has variants and copy them
$mediaWithVariants = Media::where('hash', $hash)->where('variants', '!=', '')->orderBy('created_at')->first();
if($mediaWithVariants) {
$media->variants = $mediaWithVariants->variants;
$media->save();
}
}
unlink($file->getRealPath());