[webkit-qt] Reason why webkit does not display graphics from some external Qt plugins

Harri Pasanen grego at mpaja.com
Tue Nov 9 23:34:19 PST 2010


On Monday, November 08, 2010 05:25:09 pm Benjamin Poulain wrote:
> Hello,
> 
> On 11/06/2010 03:30 PM, ext Harri Pasanen wrote:
> > After some debugging of webkit internals, I found out that if the
> > external Qt plugin does not support Size option, the following code in
> > ImageDecoderQt.cpp fails it:
> > 
> > void ImageDecoderQt::internalDecodeSize()
> > {
> > 
> >      ASSERT(m_reader);
> >      
> >      // If we have a QSize() something failed
> >      QSize size = m_reader->size();
> >      if (size.isEmpty()) {
> >      
> >          setFailed();
> >          return clearPointers();
> >      
> >      }
> >      
> >      setSize(size.width(), size.height());
> > 
> > }
> > 
> > Note that image plugins are not required to provide support for Size
> > option, so this seems a bit harsh - but perhaps this is important for
> > performance?
> 
> I created a bug report for it:
> https://bugs.webkit.org/show_bug.cgi?id=49178
> 
> It looks like the change was introduced as a smart way to detect errors
> early. The real problem is the interface QImageIOHandler which has no
> effective way to report errors.
> 
> Checking the size there is a way to detect early if there was problems
> when reading the headers.
> 
> I believe you could work around the issue without too much impact on
> performance. Reporting the failure will only be slightly delayed.
> 
> Do you plan to work to patch the problem?
> Do not forget to change ImageDecoderQt::isSizeAvailable() to avoid
> infinite loop. A test case would be more than welcome if you change this
> behavior.
> 

I work mainly in the mobile space and thus don't have control over the 
qtwebkit version used.   So I'm not planning to fix this in webkit for me, but 
by adding support for size() in the custom plugins, as I do have control over 
those.

Thanks,

-- 
Grego
http://mpaja.com/


More information about the webkit-qt mailing list