Skip to content

Commit

Permalink
feat(Documents): Set SvgRenderers higher priority than ImageRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Apr 23, 2024
1 parent 898264f commit 920f273
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions lib/Documents/src/Models/DocumentTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ trait DocumentTrait
'image/heif' => 'image',
'image/jpeg' => 'image',
'image/png' => 'image',
'image/svg' => 'image',
'image/svg+xml' => 'image',
'image/tiff' => 'image',
'image/vnd.microsoft.icon' => 'image',
Expand Down Expand Up @@ -315,11 +316,7 @@ protected function initDocumentTrait(): void
]
public function isProcessable(): bool
{
if ($this->isImage() && in_array($this->getMimeType(), static::$processableMimeTypes)) {
return true;
}

return false;
return $this->isImage() && in_array($this->getMimeType(), static::$processableMimeTypes, true);
}

#[
Expand Down
4 changes: 2 additions & 2 deletions lib/RoadizCoreBundle/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,9 @@ services:
RZ\Roadiz\Documents\Renderer\PdfRenderer:
tags: [ 'roadiz_core.document_renderer' ]
RZ\Roadiz\Documents\Renderer\SvgRenderer:
tags: [ 'roadiz_core.document_renderer' ]
tags: [ { name: 'roadiz_core.document_renderer', priority: 10 } ]
RZ\Roadiz\Documents\Renderer\InlineSvgRenderer:
tags: [ 'roadiz_core.document_renderer' ]
tags: [ { name: 'roadiz_core.document_renderer', priority: 11 } ]
RZ\Roadiz\Documents\Renderer\EmbedRenderer:
tags: [ { name: 'roadiz_core.document_renderer', priority: -128 } ]
RZ\Roadiz\Documents\Renderer\ThumbnailRenderer:
Expand Down

0 comments on commit 920f273

Please sign in to comment.