Use SVG Images with glide
Hi, I'm trying to use glide with svg Image.
I add this to twill.php
With this I can see in backend the correct image (PIC 1)
So now i'm trying to use it in frontend
When I try this with SVG image i Have this error (with cron and uncropped image)
If I use a png or jpg image all works fine!
Someone can help me?
Thank you
I add this to twill.php
'glide' => [
'original_media_for_extensions' => ['svg'],
'default_params' => [
'fm' => 'png',
'q' => '100',
'auto' => 'compress,format',
'fit' => 'min',
],
'lqip_default_params' => [
'fm' => 'webp',
'auto' => 'compress',
'blur' => 100,
'dpr' => 1,
],
],With this I can see in backend the correct image (PIC 1)
So now i'm trying to use it in frontend
$world_image = $page
->imageObjects('world_image', 'default')
->map(function ($media) use ($page) {
return @TwillImage::make($page, 'world_image', $media)->crop('default');
})->toArray();
foreach ($world_image as $k => $image) {
if (isset($image['image']['src'])) {
$data['img'] = $image['image'];
break;
}When I try this with SVG image i Have this error (with cron and uncropped image)
DivisionByZeroError thrown with message "Division by zero" Stacktrace: #57 DivisionByZeroError in /Users/mikmella/Sites/vendor/area17/twill-image/src/Services/MediaSource.php:276 #56 A17\Twill\Image\Services\MediaSource:aspectRatio in /Users/mikmella/Sites/vendor/area17/twill-image/src/Services/MediaSource.php:315 #55 A17\Twill\Image\Services\MediaSource:toArray in /Users/mikmella/Sites//vendor/area17/twill-image/src/Models/Image.php:281 ...
If I use a png or jpg image all works fine!
Someone can help me?
Thank you

