How can I encode images into a string?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Darlex
Party member
Posts: 128
Joined: Sun Sep 24, 2017 10:02 am
Location: Chile
Contact:

How can I encode images into a string?

Post by Darlex »

Hello again dudes!
I have a question. How do I encode an image into a base64 string to later be decoded into a drawable image?
Hi! I wish you have an amazing day!
Nelvin
Party member
Posts: 124
Joined: Mon Sep 12, 2016 7:52 am
Location: Germany

Re: How can I encode images into a string?

Post by Nelvin »

You can use imageData:getString and use the result with data.encode to get a base64 encoded string. Later on just reverse the operation with data.decode and image.newImageData
User avatar
AuahDark
Party member
Posts: 107
Joined: Mon Oct 23, 2017 2:34 pm
Location: Indonesia
Contact:

Re: How can I encode images into a string?

Post by AuahDark »

Profile. Do you encounter crashes in LÖVE Android and wanna send me logcats? Please hit me up in LÖVE Discord and send the full logcat file!
Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests