Alex-D / Trumbowyg

A lightweight and amazing WYSIWYG JavaScript editor under 10kB
https://alex-d.github.io/Trumbowyg
MIT License
3.99k stars 612 forks source link

Unable to upload certain optizmized image files such as .webp #1272

Closed GonrasK closed 2 years ago

GonrasK commented 2 years ago

I am building some experimental CMS with Laravel and i've been heavily relying on Trumbowyg. I've been wondering if there's an option to add the possibility to add progressive media files such as .webp and .webm via trumbowyg? Thanks.

Alex-D commented 2 years ago

Hey!

I'm not sure to understand what you want.

If you want to send different files from server to client depending on browser support, you can do that server-side based on Accept header.

If you want <figure>, I did not implement that, and I do not know how to do that in v2.

GonrasK commented 2 years ago

Sorry for being a bit unclear, but what i want to achieve is kind of described in this url. When I upload a inside the wysiwyg editor - I'd like it to go through a conversion process (in this case - to .webp), So I was wondering how is this achievable and what event should I listen to on the server side.

Alex-D commented 2 years ago

Oh, ok! So it's not related to Trumbowyg, you need to convert file at the moment the file is uploaded, then return the webp path to Trumbowyg Upload plugin :)