Bug 38554 - [Qt] The image plugin used for decoding images should be configurable
Summary: [Qt] The image plugin used for decoding images should be configurable
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Enhancement
Assignee: Nobody
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2010-05-04 16:29 PDT by Benjamin Poulain
Modified: 2014-02-03 03:16 PST (History)
2 users (show)

See Also:


Attachments
Initial implementation of configurable images loading. (8.45 KB, patch)
2011-04-14 12:52 PDT, Igor Trindade Oliveira
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2010-05-04 16:29:53 PDT
Currently, all the images plugins can be used to decode images.

That can be a security issue, one might want to avoid some image formats when decoding images from the Web: Tiff, SVG (see https://bugs.webkit.org/show_bug.cgi?id=37826), mng for example.

We could add an API in QWebSettings to name explicitly the plugins that can be loaded:
QWebSettings::disableAutoImageLoading()
QWebSettings::enableImagePlugin("jpg");
Comment 1 Igor Trindade Oliveira 2011-04-14 12:52:05 PDT
Created attachment 89629 [details]
Initial implementation of configurable images loading.

Add initial implementation of configurable images auto loading.
Right now i am just handling png and jpeg and the public api will be changed.
Comment 2 Antonio Gomes 2011-04-17 22:21:38 PDT
Comment on attachment 89629 [details]
Initial implementation of configurable images loading.

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

> Source/WebCore/page/Settings.cpp:57
> +    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
> +        frame->document()->cachedResourceLoader()->setLoadJPEGImage(page->settings()->loadsSiteJPEGImagesIgnoringImageLoadingSetting());

this could be called outside the loop.

page->settings()->loadsSiteJPEGImagesIgnoringImageLoadingSetting()

> Source/WebCore/page/Settings.cpp:63
> +    for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
> +        frame->document()->cachedResourceLoader()->setLoadPNGImage(page->settings()->loadsSitePNGImagesIgnoringImageLoadingSetting());

Ditto

> Source/WebKit/qt/Api/qwebsettings.cpp:630
> +void QWebSettings::enableLoadingImage(const QString &image)

& positioned wrong.

The goal should be clean, and comments are needed.

> Source/WebKit/qt/Api/qwebsettings.cpp:638
> +    if (image == QLatin1String("jpeg"))
> +        d->settings->setLoadsSiteJPEGImagesIgnoringImageLoadingSetting(true);
> +    else if(image == QLatin1String("png"))
> +        d->settings->setLoadsSitePNGImagesIgnoringImageLoadingSetting(true);

Only caring about these two formats?
Comment 3 Jocelyn Turcotte 2014-02-03 03:16:28 PST
=== Bulk closing of Qt bugs ===

If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary.

If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.