CC: | cpan [...] vitoco.cl |
Subject: | Image attachment gets corrupted in its MIME part (no binmode) |
An HTML document with embeded images are packed together, but the BASE64 part for the image is not being loaded in binary mode, so CR-LF pairs in binary data is being replaced by newlines on Windows!!! One byte less every time 13-10 ($0D-$0A) sequence is found.
My test case includes a PNG image that includes that sequence in the headers of the file. The first 8 bytes of every PNG file has the following sequence as a signature: 137-80-78-71-13-10-26-10.