diff --git a/plugins/Embed/Embed.php b/plugins/Embed/Embed.php index 390ab9b525..70ad1321b5 100644 --- a/plugins/Embed/Embed.php +++ b/plugins/Embed/Embed.php @@ -54,6 +54,7 @@ use App\Util\Exception\NotFoundException; use App\Util\Formatting; use App\Util\TemporaryFile; use Embed\Embed as LibEmbed; +use Exception; use Symfony\Component\HttpFoundation\Request; /** @@ -203,9 +204,6 @@ class Embed extends Plugin return Event::next; } - $width = Common::config('thumbnail', 'width'); - $height = Common::config('thumbnail', 'height'); - $smart_crop = Common::config('thumbnail', 'smart_crop'); $attributes = $embed->getImageHTMLAttributes(['class' => 'u-photo embed']); $res[] = Formatting::twigRenderString(<< $embed, 'attributes' => $attributes]); Event::handle('HashFile', [$file->getRealPath(), &$hash]); $filepath = Common::config('storage', 'dir') . "embed/{$hash}" . Common::config('thumbnail', 'extension'); - $width = Common::config('thumbnail', 'width'); - $height = Common::config('thumbnail', 'height'); - $smart_crop = Common::config('thumbnail', 'smart_crop'); - Event::handle('ResizeImagePath', [$file->getRealPath(), $filepath, $width, $height, $smart_crop, &$mimetype]); + $width = Common::config('plugin_embed', 'width'); + $height = Common::config('plugin_embed', 'height'); + $smart_crop = Common::config('plugin_embed', 'smart_crop'); + + Event::handle('ResizeImagePath', [$file->getRealPath(), $filepath, &$width, &$height, $smart_crop, &$mimetype]); unset($file); @@ -489,8 +488,8 @@ END, ['embed' => $embed, 'attributes' => $attributes]); } if (!isset($data['width'])) { - $data['width'] = Common::config('thumbnail', 'width'); - $data['height'] = Common::config('thumbnail', 'height'); + $data['width'] = Common::config('plugin_embed', 'width'); + $data['height'] = Common::config('plugin_embed', 'height'); } } diff --git a/social.yaml b/social.yaml index 72ec123530..1abdd01254 100644 --- a/social.yaml +++ b/social.yaml @@ -120,6 +120,13 @@ parameters: height: 600 extension: '.webp' + plugin_embed: + width: 128 + height: 128 + smart_crop: false + dir: "%kernel.project_dir%/file/embed/" + + theme: server: ssl: