Bug 32428 - [Qt] ImageDecoderQt fails to provide image file extensions
Summary: [Qt] ImageDecoderQt fails to provide image file extensions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-11 05:38 PST by Andreas Kling
Modified: 2009-12-11 06:39 PST (History)
4 users (show)

See Also:


Attachments
Retrieve the format immediately after creating the QImageReader (1.50 KB, patch)
2009-12-11 06:11 PST, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2009-12-11 05:38:17 PST
QImageReader only allows retrieving the format() before having read the image.

(See http://doc.trolltech.com/4.6/qimagereader.html#format for more information.)

The most obvious symptom of this bug is a failing assertion when attempting to click-and-drag an image:

ASSERTION FAILED: !image->filenameExtension().isEmpty()
(../../../WebCore/page/DragController.cpp:675 bool WebCore::DragController::startDrag(WebCore::Frame*, WebCore::Clipboard*, WebCore::DragOperation, const WebCore::PlatformMouseEvent&, const WebCore::IntPoint&, bool))
Comment 1 Andreas Kling 2009-12-11 06:11:53 PST
Created attachment 44680 [details]
Retrieve the format immediately after creating the QImageReader
Comment 2 WebKit Review Bot 2009-12-11 06:12:36 PST
style-queue ran check-webkit-style on attachment 44680 [details] without any errors.
Comment 3 Simon Hausmann 2009-12-11 06:28:26 PST
Comment on attachment 44680 [details]
Retrieve the format immediately after creating the QImageReader

r=me

Holger, would be great if you could double-check it, too. But from all I can see this seems like a safe thing to do. Calling format() will only initialize the handler (which we need to do anyway), but otherwise retrieving the format doesn't trigger any of the expensive decoding work.

We _could_ also do the initHandler() part on demand. But right now this patch seems safe and it fixes a failing assertion (crash) in the DragController when dragging images. (the assertion being that the format must be non-empty)
Comment 4 WebKit Commit Bot 2009-12-11 06:38:46 PST
Comment on attachment 44680 [details]
Retrieve the format immediately after creating the QImageReader

Clearing flags on attachment: 44680

Committed r51983: <http://trac.webkit.org/changeset/51983>
Comment 5 WebKit Commit Bot 2009-12-11 06:39:00 PST
All reviewed patches have been landed.  Closing bug.