Version: 4.7 (using KDE 4.7.0) OS: Linux The size of a Base64 encoded attachment shown in the attachment overview of the composer is incorrect. The size is apparently calculated as 75% of the original file size, but this is incorrect. A Base64 encoded file is 33% larger than the file it is created from. Reproducible: Always Steps to Reproduce: 1. Create a new email (open a composer window). 2. Choose 'Attach File' from the 'Attach' menu. 3. Select a binary file and remember the file size. 4. Compare the file size shown in the attachment overview with the real size. Actual Results: The file size shown in the attachment overview is 75% of the original file size. Expected Results: Either the original file size or the size after Base64 encoding should be shown.
I confirm that i get the exact same problem.
Created attachment 68218 [details] Patch for kmime_content.cpp to fix this issue Still appears broken in 4.8.0. Hopefully this patch is the right approach to fixing it. Rather than simply changing the existing logic from the current size*3/4 to size*4/3 I've used the maxEncodedSizeFor method from Base64Codec for a hopefully more accurate estimate.
Git commit d6eac430bd23c0552b3b768305f21348c457d088 by Montel Laurent. Committed on 27/01/2012 at 10:01. Pushed by mlaurent into branch 'master'. Fix Bug 280026 - Incorrect size of Base64 encoded attachment Apply patch from thomas.kear@gmail.com FIXED-IN: 4.8.1 CCMAIL: thomas.kear@gmail.com M +2 -1 kmime/kmime_content.cpp http://commits.kde.org/kdepimlibs/d6eac430bd23c0552b3b768305f21348c457d088
Git commit d9ec6fa8da51a367896b9ab8c2f1a75784b33499 by Montel Laurent. Committed on 27/01/2012 at 10:01. Pushed by mlaurent into branch 'KDE/4.8'. Fix Bug 280026 - Incorrect size of Base64 encoded attachment Apply patch from thomas.kear@gmail.com FIXED-IN: 4.8.1 CCMAIL: thomas.kear@gmail.com (cherry picked from commit d6eac430bd23c0552b3b768305f21348c457d088) M +2 -1 kmime/kmime_content.cpp http://commits.kde.org/kdepimlibs/d9ec6fa8da51a367896b9ab8c2f1a75784b33499