UBB.Dev
Posted By: Gizmo CustomBB Code: WebP Image - 04/02/2021 2:44 AM
WebP is an image format developed and first released by Google in 2010. It supports encoding images in both lossless and lossy formats, making it a versatile format for any type of visual media, and a great alternative format to both PNG or JPEG. WebP’s visual quality is often comparable to more ubiquitous formats.

This Custom Tag allows you to embed them within your posts in UBB.threads.

Example at VNC Web Services.

CustomTags.txt
Code
<?php
$export_tags = array (
  0 => 
  array (
    'tag' => 'webp',
    'descrip' => 'Embed WebP Image',
    'prompt' => 'Image URL; eg: https://www.example.com/images/image.webp',
    'regex' => '([a-zA-Z0-9-_.&:/]+)',
    'markup' => '<img src="\\\\1" style="max-width:100%;">',
  ),
);
?>
Posted By: Ruben Rocha Re: CustomBB Code: WebP Image - 04/02/2021 4:39 PM
I knew you could do it Giz.
Works perfect.
I have one question
Why does the name show as [new]Embed WebP Image?

Is there a way to get rid of new?
Posted By: Gizmo Re: CustomBB Code: WebP Image - 04/02/2021 4:51 PM
Because it is a newly imported tag, rename it.
Posted By: Ruben Rocha Re: CustomBB Code: WebP Image - 04/02/2021 4:55 PM
That is what I did but was confused where the new came from it was not in the import script.
Posted By: Gizmo Re: CustomBB Code: WebP Image - 04/02/2021 5:14 PM
It's just appended through the import process.
Posted By: Morgan Re: CustomBB Code: WebP Image - 04/02/2021 6:40 PM
Gizmo

https://www.virtualnightclub.net/forum/ubbthreads.php/topics/3119/webp-image-tag.html
Feedback, I tested your example link above using Safari and chrome

Safari failed to open the image but in chrome I noticed the good looking car image.
Posted By: isaac Re: CustomBB Code: WebP Image - 04/03/2021 12:35 AM
Originally Posted by Morgan
Safari failed to open the image but in chrome I noticed the good looking car image.

That is an Apple issue. Safari only provides partial support for the WebP image format, and is limited to macOS 11 Big Sur and later.

https://caniuse.com/webp

[Linked Image]

Attached picture 20210402_17-31-13.PNG
Posted By: Gizmo Re: CustomBB Code: WebP Image - 04/03/2021 12:50 AM
Simplifying Isaac's post, Safari doesn't support it; there's nothing wrong with the code.
Posted By: Morgan Re: CustomBB Code: WebP Image - 04/04/2021 8:13 PM
Thanks for the info
I only posted feedback and now I know.
My old Imac use Safari version 11.1.2 (11605.3.8.1).
Am using Chrome a lot more nowadays.

Cheers
© UBB.Developers