Adding WebP images!

Post Reply
kolimbursi
Ssr. Bludit
Posts: 24
Joined: Tue Feb 11, 2020 10:00 am

Hello! Since I run a Bludit eCommerce store - I am very interested in uploading WebP images to save bandwidth. Is it possible for Bludit to workaround? When I try to upload WebP files it says the file format is unsupported.

Thanks for your help!
kolimbursi
Ssr. Bludit
Posts: 24
Joined: Tue Feb 11, 2020 10:00 am

I already added: $GLOBALS['ALLOWED_IMG_EXTENSION'] = array('gif', 'png', 'jpg', 'jpeg', 'svg', 'webp');

But where to place the mime-type image/webp ? I am novice sry

Bludit Version 3.12.0
kolimbursi
Ssr. Bludit
Posts: 24
Joined: Tue Feb 11, 2020 10:00 am

After looking into it - there is much more coding required I think - with image resizing and so on. If there is any way we can add webp support please help! :)
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

kolimbursi wrote: Sat Mar 28, 2020 10:55 am I already added: $GLOBALS['ALLOWED_IMG_EXTENSION'] = array('gif', 'png', 'jpg', 'jpeg', 'svg', 'webp');

But where to place the mime-type image/webp ? I am novice sry
The mime-type can be added in the file media.php in the directory /bl-kernel/admin/themes/booty/html (lines 181/182):

Code: Select all

// Check file type/extension
const validImageTypes = ['image/gif', 'image/jpeg', 'image/png', 'image/svg+xml','image/webp'];
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

kolimbursi wrote: Sat Mar 28, 2020 12:33 pm After looking into it - there is much more coding required I think - with image resizing and so on.
What do you mean with "image resizing and so on".

Normally the modification of images is done with a graphics editor.
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
kolimbursi
Ssr. Bludit
Posts: 24
Joined: Tue Feb 11, 2020 10:00 am

thanks! I will try it out!
kolimbursi
Ssr. Bludit
Posts: 24
Joined: Tue Feb 11, 2020 10:00 am

thank you it works!
It has a slight problem - it doesn't show thumbnails (in the uploader) like the other images but when the image is inserted it shows properly! This way I can save a lot of bandwidth
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

kolimbursi wrote: Sat Mar 28, 2020 7:25 pm It has a slight problem - it doesn't show thumbnails (in the uploader) like the other images [...]
Perhaps this can be added. You can post a feature request on Github:

https://github.com/bludit/bludit/issues
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply