Need image to base64


#1

i look up extentions image to base64
like : https://www.base64-image.de


#2

#3

this extention only bmp file, i want jpg file


#4

i guess you didn’t look here. There you see they are using an jpg.


#5

i try use com.ghostfox.SimpleBase64.aix, but error :
Attempt to invoke virtual method ‘boolean android.graphics.Bitmap.compress(android.graphics.Bitmap$CompressFormat, int, java.io.OutputStream)’ on a null object reference


#6

Please show your blocks


#7



#8

this my block…
because the file size is too big?


#9

Test it with a smaller image.


#10

smaller image success


#11

So it has to do with imagesize then.


#12

yes, and now I have to look for extensions for the camera to automatically change the quality of the photos :pensive:


#13

No that is not the problem, Peter. What you have to do is to replace “file://” with an empty text before passing to Encode method. So it would be Encode(Replace(text: path; target: “file://”; replacement: “”;))


#14

please, show block?
i don’t understand


#15

Don’t pass image’s raw path to Encode function. First replace “file://” in your path with “” and then use Encode function.


#16

Hey I Also Have Same Problem Can AnyOne Solve My Problem


plz solve my problem as much as possible


#17

Did you read the topic and did it work for you?


#18

Please read my 2 older replies here.