Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70443

Ionic 4 Transforming base64Image to url and showing it

$
0
0

@SanduCuragau wrote:

Cheers
All this is local since its all tests for now, in the future I’ll keep the things on cloud.

What I’m trying to do right now is:

  • have user’s image being displayed on the menu
  • when he clicks it he can choose an image from his gallery
  • set that image as his profile picture
    I do all this by using the Camera and CameraOptions, but when I do this I get a base64image which is like 300kb each, which I keep on the database as the user’s image reference, but that’s insanely big to be a reference, specially since there’ll be many users, so I need that reference to be wayyyyy smaller, I found a way to do so

just in case its needed, this is how I get the image and set it as his profile picture, works fine
image
but as u can see at the end I send the image to yet another method I have, well I wanted that method to create a smaller link for the image and then there set it as a profile picture instead with that smaller link, but since it’s not working, for now I’m setting the avatar with the base64 reference

Here is the method that’s supposed to convert it

And appearently it really does, the dataUrl really ends up being exactly what I’d hope for

BUT, thing is, setting the image with the new smaller link isn’t working

This is how it’s displayed on html

how come does it work with the longer reference but not with the shorter one

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>