Thread: jpeg data in mbox files

  1. #1
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300

    jpeg data in mbox files

    Does anyone know how to read the jpeg data embedded in email messages? Each, something that starts like this:
    Code:
    --Apple-Mail-4-620893417
    Content-Transfer-Encoding: base64
    Content-Type: image/jpeg; x-mac-type=4A504547; x-unix-mode=0644;
            name=IMG_0164.jpg
    Content-Disposition: inline; filename=IMG_0164.jpg
    
    /9j/4R1GRXhpZgAATU0AKgAAAAgADAEPAAIAAAAGAAAAngEQAAIAAAAVAAAApAESAAMAAAABAAEA
    AAESAAMAAAABAAEAAAEaAAUAAAABAAAAugEbAAUAAAABAAAAwgEoAAMAAAABAAIAAAExAAIAAAAO
    AAAAygEyAAIAAAAUAAAA2AE8AAIAAAAQAAAA7AITAAMAAAABAAEAAIdpAAQAAAABAAAA/AAAB3BD
    YW5vbgBDYW5vbiBQb3dlclNob3QgQTUxMAAAALQAAAABAAAAtAAAAAEAAFF1aWNrVGltZSA3LjMA
    MjAwNzoxMToyMyAwODoxODoyOQBNYWMgT1MgWCAxMC40LjkAAB6CmgAFAAAAAQAAAmqCnQAFAAAA
    AQAAAnKQAAAHAAAABDAyMjCQAwACAAAAFAAAAnqQBAACAAAAFAAAAo6RAQAHAAAABAECAwCRAgAF
    AAAAAQAAAqKSAQAKAAAAAQAAAqqSAgAFAAAAAQAAArKSBAAKAAAAAQAAArqSBQAFAAAAAQAAAsKS
    BwADAAAAAQAFAACSCQADAAAAAQBZAACSCgAFAAAAAQAAAsqSfAAHAAADfgAAAtKShgAHAAABCAAA
    Notice, the lines are broken at 76 characters and this *IS NOT* normal jpeg data such as you would read from from an HTTP response, but I can't find any info on the web...
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Doesn't this just base64 decode to binary data? Not sure about the line breaks though.

  3. #3
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Not sure about the line breaks though.
    Actually, from the Base64 wiki:
    MIME does not specify a fixed length for base64-encoded lines, but it does specify a maximum line length of 76 characters.

  4. #4
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by bithub View Post
    Doesn't this just base64 decode to binary data? Not sure about the line breaks though.
    Will check! Thanks bithub.

    [later] yup. whew!
    Last edited by MK27; 07-30-2009 at 01:11 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. reading data contents from files in c++
    By shaheel in forum C++ Programming
    Replies: 4
    Last Post: 04-13-2008, 09:02 PM
  2. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  3. Adding files of numerical data
    By Boucho in forum C Programming
    Replies: 4
    Last Post: 02-06-2006, 05:27 PM
  4. Replies: 12
    Last Post: 10-17-2005, 06:49 AM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM