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 -3
View File
@@ -52,9 +52,10 @@ class BookResource extends JsonResource
return null;
}
$coverPath = storage_path('covers/book/'.$this->id.'.jpg');
if (file_exists($coverPath)) {
return url('/covers/book/'.$this->id.'.jpg');
$coverPath = storage_path('covers/book/'.$this->id.'.webp');
$legacyPath = storage_path('covers/book/'.$this->id.'.jpg');
if (file_exists($coverPath) || file_exists($legacyPath)) {
return url('/covers/book/'.$this->id.'.webp');
}
return null;