[webkit-dev] IMG tag

Darin Adler darin at apple.com
Thu Mar 19 14:24:27 PDT 2009


On Mar 19, 2009, at 1:51 PM, Ravi Ramachandra wrote:

> I am very new to webkit. Pardon my silly question.
> I wanted to know when and where do we decode a JPEG image file?
>
> For example if on a HTML page if i encounter <IMG/> tag and with  
> that tag we have a src=".http:///xxxx/some_picture.jpg", how does  
> webkit render this?
> It needs to decode this MIME type and i know webkit has a JPEG  
> decoder built into it, but i am unable to find a right place in code.

The decoder is not chosen based on the MIME type. It’s chosen based on  
the actual image data. Bitmap work in <img> tags even if the wrong  
type is given, unless the type happens to be the type of one of the  
non-bitmap images (application/pdf or image/svg+xml).

The class that handles image decoding is ImageSource. For Android, you  
can look at the header ImageDecoder.h for some more details.

     -- Darin



More information about the webkit-dev mailing list