| Summary: | [patch] http upload scrambles png images | ||
|---|---|---|---|
| Product: | [Applications] konqueror | Reporter: | M <maxozilla> |
| Component: | khtml forms | Assignee: | Unassigned bugs <unassigned-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | critical | CC: | nicolasg |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Test PNG image | ||
|
Description
M
2004-06-28 21:13:30 UTC
Have you tried to download them again and see if there are still the same? (Mozilla complain that they are corrupt.) Have a nice day! pngcheck complains that the file were corrupted: "... file CORRUPTED by text compression." (file complains too.) So please check how you have uploaded the files, if you do not feel having done anything wrong try to upload the file again with Mozilla (or any other browser) to know if the problem is KDE Bugs or Konqueror. Have a nice day! Created attachment 6517 [details]
Test PNG image
So I was able to upload and download the file ( attachment #6517 [details] ) with Konqueror 3.1.4-SuSE 9.0 without corruption. (Mozilla 1.4 can download and display this file correctly.)
Have a nice day!
Experencied the same (broken image upload) with KDE/HEAD recently. The patch in http://bugs.kde.org/show_bug.cgi?id=83098#c6 suggests that it's an khtml bug. CVS commit by coolo: reverting Waldo's commit (for #83098) for beta2. I've got another fix reviewed by Dirk and Waldo, but that will need some more testing CCMAIL: 84179-done@bugs.kde.org CCMAIL: 83098@bugs.kde.org M +3 -36 html_formimpl.cpp 1.377 --- kdelibs/khtml/html/html_formimpl.cpp #1.376:1.377 @@ -110,36 +110,4 @@ long HTMLFormElementImpl::length() const } -static QCString expandLF(const QCString& s) -{ - // LF -> CRLF - unsigned crs = s.contains( '\n' ); - if (crs == 0) - return s; - unsigned len = s.length(); - - QCString r(len + s.contains( '\n') *2 + 1); - unsigned pos2 = 0; - for(unsigned pos = 0; pos < len; pos++) - { - char c = s[pos]; - switch(c) - { - case '\n': - r[pos2++] = '\r'; - r[pos2++] = '\n'; - break; - - case '\r': - break; - - default: - r[pos2++]= c; - break; - } - } - r.truncate(pos2); - return r; -} - static QCString encodeCString(const QCString& e) { @@ -318,8 +286,7 @@ QByteArray HTMLFormElementImpl::formData // append body unsigned int old_size = form_data.size(); - QCString body = expandLF(*it); - form_data.resize( old_size + hstr.length() + body.size() + 1); + form_data.resize( old_size + hstr.length() + (*it).size() + 1); memcpy(form_data.data() + old_size, hstr.data(), hstr.length()); - memcpy(form_data.data() + old_size + hstr.length(), body.data(), body.size()); + memcpy(form_data.data() + old_size + hstr.length(), *it, (*it).size()); form_data[form_data.size()-2] = '\r'; form_data[form_data.size()-1] = '\n'; |