To resize a base64 image in JavaScript, we can make use of the HTML5 canvas element. The steps involved are:
Here's the code:
index.tsx847 chars30 lines
Note: The above code will work only if the base64 image is of a supported format (e.g., PNG, JPEG, GIF).
gistlibby LogSnag