Commit 28ce677a authored by hausmann@webkit.org's avatar hausmann@webkit.org

2009-05-04 Jakub Wieczorek <faw217@gmail.com>

        Reviewed by Simon Hausmann.

        As Qtish implementation of MIMETypeRegistry::getMIMETypeForExtension()
        returns the application/octet-stream mimetype when it can't associate
        extension with any mimetype, it can happen that the application/octet-stream
        mimetype will hit the list of supported image formats. For instance,
        it is possible when QImageReader or QImageWriter support an extension
        that is not in the extensions map.

        Make sure that this mimetype is not treated as displayable image type.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1c5aca14
2009-05-04 Jakub Wieczorek <faw217@gmail.com>
Reviewed by Simon Hausmann.
As Qtish implementation of MIMETypeRegistry::getMIMETypeForExtension()
returns the application/octet-stream mimetype when it can't associate
extension with any mimetype, it can happen that the application/octet-stream
mimetype will hit the list of supported image formats. For instance,
it is possible when QImageReader or QImageWriter support an extension
that is not in the extensions map.
Make sure that this mimetype is not treated as displayable image type.
* platform/MIMETypeRegistry.cpp:
(WebCore::initializeSupportedImageMIMETypes):
(WebCore::initializeSupportedImageMIMETypesForEncoding):
2009-05-03 Eric Seidel <eric@webkit.org>
Reviewed by Simon Fraser.
......@@ -100,6 +100,9 @@ static void initializeSupportedImageMIMETypes()
supportedImageMIMETypes->add(mimeType);
supportedImageResourceMIMETypes->add(mimeType);
}
supportedImageMIMETypes->remove("application/octet-stream");
supportedImageResourceMIMETypes->remove("application/octet-stream");
#else
// assume that all implementations at least support the following standard
// image types:
......@@ -145,6 +148,8 @@ static void initializeSupportedImageMIMETypesForEncoding()
String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData());
supportedImageMIMETypesForEncoding->add(mimeType);
}
supportedImageMIMETypesForEncoding->remove("application/octet-stream");
#elif PLATFORM(CAIRO)
supportedImageMIMETypesForEncoding->add("image/png");
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment