[Webkit-unassigned] [Bug 47512] Add support for decoding WebP image

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 12 20:18:16 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=47512





--- Comment #13 from Adam Barth <abarth at webkit.org>  2010-10-12 20:18:16 PST ---
> It's not going to be a huge deal to change this code.  But the code assumes that it sits underneath other sniffing/parsing code that has already made a determination that this bytestream should be fed to the ImageDecoder.

I don't believe that's correct.  If you point an <img src="..."> at an URL, the bytes you get back to the server will come to this function.

Now, you might say that the result is indistinguishable because the image library will reject files that don't have the proper format, but that assumes the image library is correct and/or bug free.

> There is a WebPGetInfo(*) function for validating the header in the library which is exactly meant
> for that: central call point for sniffing data. I didn't use it here because, as said, it requires
> 30 bytes of data in order to go into great details validating everything that can be.

Unfortunately, this function won't be available everywhere that needs to sniff for WebP.  That's why we use signatures that boil down to a simple mask-and-compare.

> Should i use it instead (for instance, disguised as a static member bool WEBPDecoder::Validate(data, data_size)? 

It's better to use a standardized signature instead so that everyone who touches the byte stream agrees about whether or not it should be treated as WebP.

I don't mean to make a big deal out of the signature.  It's just a detail in the grand scheme of things, but it's a detail I'd like to get right before we paint ourselves into a corner.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list