Bug 85036 - [BlackBerry] Rendering bmp file as text file when Content-Type:image/x-ms-bmp from apache web server.
Summary: [BlackBerry] Rendering bmp file as text file when Content-Type:image/x-ms-bmp...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit BlackBerry (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Other
: P2 Normal
Assignee: Rob Buis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-27 01:50 PDT by Jason Liu
Modified: 2012-05-04 14:13 PDT (History)
4 users (show)

See Also:


Attachments
Patch (1.56 KB, patch)
2012-04-27 18:48 PDT, Jason Liu
no flags Details | Formatted Diff | Diff
Patch (14.29 KB, patch)
2012-05-04 11:17 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (14.30 KB, patch)
2012-05-04 11:32 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (14.29 KB, patch)
2012-05-04 12:31 PDT, Rob Buis
tonikitoo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Liu 2012-04-27 01:50:45 PDT
1. Go to
http://browser.swlab.rim.net/test/rendering/html/EnclosureElements/bmp.bmp


Expected:
   See the picture
Actual:
    BM6g6........................(garbage text display)
Comment 1 Jason Liu 2012-04-27 18:48:29 PDT
Created attachment 139315 [details]
Patch
Comment 2 Rob Buis 2012-05-04 10:54:11 PDT
Comment on attachment 139315 [details]
Patch

I know of a more generic fix that also removed the pjpeg hack, that one did not seem very elegant.
Comment 3 Rob Buis 2012-05-04 11:17:16 PDT
Created attachment 140280 [details]
Patch
Comment 4 WebKit Review Bot 2012-05-04 11:21:06 PDT
Attachment 140280 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebKit/blackberry/Api/WebSettings.cpp:24:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Rob Buis 2012-05-04 11:32:42 PDT
Created attachment 140284 [details]
Patch
Comment 6 Antonio Gomes 2012-05-04 11:43:48 PDT
Comment on attachment 140284 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=140284&action=review

> Source/WebCore/platform/MIMETypeRegistry.cpp:689
> +String MIMETypeRegistry::getNormalizedMIMEType(const String& mimeType)

can this be inline?

> Source/WebCore/platform/MIMETypeRegistry.cpp:696
> +#if PLATFORM(BLACKBERRY)
> +    MIMETypeAssociationMap::const_iterator it = mimeTypeAssociationMap().find(mimeType);
> +
> +    return it == mimeTypeAssociationMap().end() ? mimeType : it->second;
> +#else
> +    return mimeType;

691#if PLATFORM(BLACKBERRY)
 692 MIMETypeAssociationMap::const_iterator it = mimeTypeAssociationMap().find(mimeType);
 693 if (it != mimeTypeAssociationMap().end())
 694     return it->second;
 695#endif
 696 return mimeType;
Comment 7 Rob Buis 2012-05-04 12:29:01 PDT
(In reply to comment #6)
> (From update of attachment 140284 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=140284&action=review
> 
> > Source/WebCore/platform/MIMETypeRegistry.cpp:689
> > +String MIMETypeRegistry::getNormalizedMIMEType(const String& mimeType)
> 
> can this be inline?

I know what you mean, would be better for performance, but a lot of datastructure stuff would have to be moved into the header.
Comment 8 Rob Buis 2012-05-04 12:31:03 PDT
Created attachment 140298 [details]
Patch
Comment 9 Rob Buis 2012-05-04 14:13:42 PDT
Landed in r116145.