Adding WebP images!

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

Fri Mar 27, 2020 9:18 pm

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

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

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

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. If there is any way we can add webp support please help! :)
User avatar
Edi
Site Admin
Posts: 1909
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Sat Mar 28, 2020 6:14 pm

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 (lines 181/182):

Code: Select all

// Check file type/extension
const validImageTypes = ['image/gif', 'image/jpeg', 'image/png', 'image/svg+xml','image/webp'];
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
User avatar
Edi
Site Admin
Posts: 1909
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Sat Mar 28, 2020 6:19 pm

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.
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
kolimbursi
Ssr. Bludit
Posts: 24
Joined: Tue Feb 11, 2020 10:00 am

Sat Mar 28, 2020 7:21 pm

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

Sat Mar 28, 2020 7:25 pm

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: 1909
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Contact:

Sat Mar 28, 2020 7:48 pm

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
Planet Bludit, Tipps, Snippets und nützliche Links. - Newsletter, Informationen zu Bludit (auf Deutsch).
Post Reply