In this articles, we will get exact length Base64 photo from ionic native Camera|Gallery in Kilobytes.
Base64 encodes three bytes to four characters. Sometimes, padding is added in the form of one or two ‘=’ characters.
To get the length of bytes we use the formula:
Step 1: Create and add an ionic native-camera plugin
Step 2: Add Typescript code to calculate base64 image size in KiloBytes in home.ts
Step 3: Add User Interface in home.html