Thanks Erel, for responding.
Okay, so there is a difference between the downloaded file and the original.
I tried two images I had on my hard drive:
- "IdeaDrivedrawing.JPG"
- "Birds_flying.bmp"
First screenshot ("POP3_downloads[1].png") shows how the files show up on my device after POP3 download. These files would not display and when I tried initializing a bitmap, I encountered: "java.lang.RuntimeException: Error loading bitmap."
Dim TestBitmap as bitmap
TestBitmap.Initialize(File.DirDefaultExternal & "/momblog/images/", MailParser.filename)
The original "IdeaDrivedrawing.JPG" had two additional bytes: FF and D9 at the end of the file that the POP3 downloaded file did not have.
The original "Birds_flying.bmp" had three additional bytes: 00, 00 and 00 at the end.
I loaded the POP3 versions into my hex editor and added the missing bytes, then copied them back to my phone where they then worked as expected. they also show up as images in my file manager too. (See next screenshot ("Files_fixed[1].png")
Somewhere they are losing some bytes.
I included the POP3 example with the mailparser module where I added media scanning code immediately after it saves the attachment in the Sub HandlePart().
Also, added the following line as per rboeck's suggestion previously in this thread:
If nextPart = -1 Then nextPart = Mail.Length + 4
in Sub ParseMultipartBody().
Could you please have a look at the mailparser (or maybe even DecodeBase64) to see if there is something amiss?
My hardware is rooted Galaxy S5 connected to dev computer via USB cable. Will try same experiment at home with WiFi bridge.
Thank you.
-bryon