i'm using this function before I upload it, I do not notice any negative, but this function is only a little bit different to yours
B4X:
'Converts an image to a bytes array (for BLOB fields).
Public Sub ImageToBytes(Image As Bitmap) As Byte()
Dim out As OutputStream
out.InitializeToBytesArray(0)
Image.WriteToStream(out, 100, "JPEG")
out.Close
Return out.ToBytesArray
End Sub
i'm using this function before I upload it, I do not notice any negative, but this function is only a little bit different to yours
B4X:
'Converts an image to a bytes array (for BLOB fields).
Public Sub ImageToBytes(Image As Bitmap) As Byte()
Dim out As OutputStream
out.InitializeToBytesArray(0)
Image.WriteToStream(out, 100, "JPEG")
out.Close
Return out.ToBytesArray
End Sub
You are loading an image and then saving it again in a different format (PNG if you are using B4J).
If you have access to the files then add them directly instead of loading them as images.