Make webp default format for images

This commit is contained in:
DariusIII
2026-07-16 15:57:20 +02:00
parent 17be0e11d2
commit b27fb8d86b
60 changed files with 1154 additions and 1136 deletions
+4 -4
View File
@@ -160,11 +160,12 @@
</label>
<div class="border border-gray-300 dark:border-gray-600 rounded-lg p-4 bg-gray-50 dark:bg-gray-900">
@php
$coverPath = public_path('covers/console/' . $con['id'] . '.jpg');
$hasCover = file_exists($coverPath);
$coverPath = public_path('covers/console/' . $con['id'] . '.webp');
$legacyCoverPath = public_path('covers/console/' . $con['id'] . '.jpg');
$hasCover = file_exists($coverPath) || file_exists($legacyCoverPath);
@endphp
@if($hasCover)
<img src="{{ asset('covers/console/' . $con['id'] . '.jpg') }}"
<img src="{{ asset('covers/console/' . $con['id'] . (file_exists($coverPath) ? '.webp' : '.jpg')) }}"
alt="{{ $con['title'] }}"
class="max-w-full h-auto mx-auto rounded shadow-lg img-max-h-400">
@else
@@ -240,4 +241,3 @@
{{-- Scripts moved to resources/js/csp-safe.js --}}
@endsection