paint-brush
Testing for Image Format Support Using Simple JavaScript by@bobnoxious
148 reads

Testing for Image Format Support Using Simple JavaScript

by Bob Wright2mMarch 7th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Here are two simple Async/Await JavaScript scripts that will detect and indicate browser support for the AVIF and WEBP image formats. The method used here is to attempt to create an image object in the test format from a base64 encoded representation of the image. Here below is the content of the two scripts.
featured image - Testing for Image Format Support Using Simple JavaScript
Bob Wright HackerNoon profile picture
Bob Wright

Bob Wright

@bobnoxious

Bob has been designing hardware and coding software for decades. He likes to draw and write. He’s a web cadet wannabe.

About @bobnoxious
LEARN MORE ABOUT @BOBNOXIOUS'S
EXPERTISE AND PLACE ON THE INTERNET.
0-item

STORY’S CREDIBILITY

Code License

Code License

The code in this story is for educational purposes. The readers are solely responsible for whatever they build with it.

L O A D I N G
. . . comments & more!

About Author

Bob Wright HackerNoon profile picture
Bob Wright@bobnoxious
Bob has been designing hardware and coding software for decades. He likes to draw and write. He’s a web cadet wannabe.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite