0

I've been making the create account and edit profile page for a kony app. The information of the created server is stored on a server.

My problem is, the profile picture that is captured by the phone or imported from the gallery is much bigger than it has to be. Is there a way to reduce the image size so that it's not such a heavy load to upload on creating an account?

Kony uses javascript as it's code behind so if there is a way using javascript I would really appreciate that.

I currently have the image available in rawbytes and then I convert it to base64 so that it can be stored on the database. So I need to reduce its size somehow to make the account creation and update process run more smoothly. Possibly may need to store it in some other format.

Barry Michael Doyle
  • 9,333
  • 30
  • 83
  • 143
  • Images are already compressed. Images can be resized (to a smaller number of pixels) or they can use a more lossy compression which reduces the quality of the image. Either will make the resulting image data smaller. Also, base64 is not an efficient storage mechanism at all. Are you sure you cannot store binary data in your database? – jfriend00 Jan 24 '16 at 20:50
  • did you try a search for `resize image javascript`? Should give you plenty of reading – charlietfl Jan 24 '16 at 20:55
  • Ok I didn't know that, I've edited the question. – Barry Michael Doyle Jan 24 '16 at 20:55
  • @jfriend00 , I most likely can store the image as binary data on the db, I'm just not sure how that's done (function to convert from rawBytes to binary) – Barry Michael Doyle Jan 24 '16 at 20:56
  • I would presume that `rawbytes === binary` already. What exactly do you mean when you say `rawbytes`? – jfriend00 Jan 24 '16 at 20:58
  • Hmmm, I didn't know that either... – Barry Michael Doyle Jan 24 '16 at 21:00
  • Base64 encoding makes the data larger, so if you can store the binary data you already have that will be a savings right there. – jfriend00 Jan 24 '16 at 21:01
  • Did some more looking up about this: http://stackoverflow.com/questions/201479/what-is-base-64-encoding-used-for – Barry Michael Doyle Jan 25 '16 at 09:17
  • After learning how to approach this problem I've asked a more specific question here: http://stackoverflow.com/questions/34989218/resize-an-image-file-size-in-kony-visualizer – Barry Michael Doyle Jan 25 '16 at 10:10

0 Answers0