Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Base64 Encoded String Is Incomplete

I'm trying to convert an image byte to base64 encoded string, this operation is successfull but when i print out the encoded string i get the ff:

/9j/4RgvRXhpZgAASUkqAAgAAAANAAABBAABAAAAQAYAAAEBBAABAAAAsAQAAA8BAgAIAAAAqgAAABABAgAIAAAAsgAAABIBAwABAAAACAAAABoBBQABAAAAugAAABsBBQABAAAAwgAAACgBAwABAAAAAgAAADEBAgANAAAAygAAADIBAgAUAAAA2AAAABMCAwABAAAAAQAAAGmHBAABAAAA7AAAACWIBAABAAAA7gIAAAADAABzYW1zdW5nAFNNLVA1NTUASAAAAAEAAABIAAAAAQAAAFA1NTVYWFUxQ1JBMgAAMjAxOTowMToxNCAwOTozMzoyOAAZAJqCBQABAAAAHgIAAJ2CBQABAAAAJgIAACKIAwABAAAAAgAAACeIAwABAAAAZAAAAACQBwAEAAAAMDIyMAOQAgAUAAAALgIAAASQAgAUAAAAQgIAAAGRBwAEAAAAAQIDAAKSBQABAAAAVgIAAAWSBQABAAAAXgIAAAeSAwABAAAAAgAAAAiSAwABAAAAAAAAAAmSAwABAAAAAAAAAAqSBQABAAAAZgIAAHySBwBiAAAAbgIAAACgBwAEAAAAMDEwMAGgAwABAAAAAQAAAAKgBAABAAAAQAYAAAOgBAABAAAAsAQAAAWgBAABAAAA0AIAABeiAwABAAAAAgAAAAGjBwABAAAAAQAAAAKkAwABAAAAAAAAAAOkAwABAAAAAAAAAAakAwABAAAAAAAAAAAAAAABAAAAFAAAAPAAAABkAAAAMjAxOTowMToxNCAwOTozMzoyOAAyMDE5OjAxOjE0IDA5OjMzOjI4AP0AAABkAAAA/QAAAGQAAADrAAAAZAAAAAcAAQAHAAQAAAAwMTAwA

An encoded string is supposed to be way more than the characters above. Now when i try to view this by appending data:image/jpeg;base64, to the begin of the encoded string, nothing gets displayed.

Is flutter cutting the string in the console or what and if yes then how do i get the complete encoded string.

like image 812
marvin ralph Avatar asked Jan 18 '26 17:01

marvin ralph


1 Answers

For me base64 is not showing completely. if that the case, print() and debugPrint() both are used for logging in the console. If you are use print() and output is too much at once, then Android sometimes discards some log lines. To avoid this, use debugPrint().

like image 160
Shahryar Rafique Avatar answered Jan 21 '26 06:01

Shahryar Rafique



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!