Bug 183257 - [WPE] Add support for WebP encoding in HTMLCanvasElement
Summary: [WPE] Add support for WebP encoding in HTMLCanvasElement
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WPE WebKit (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-01 13:24 PST by Carlos Bentzen
Modified: 2019-08-25 18:57 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Bentzen 2018-03-01 13:24:49 PST
Currently LayoutTests/fast/canvas/canvas-toDataURL-webp.html fails.

I think the path to implement it is:
- Add WebPImageEncoder.{h,cpp} to Source/WebCore/platform/image-encoders and implement compressRGBABigEndianToWebP() using libwebp
- Extend encodeImage() in Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp to use the encoder implemented.
- Add WebP encoding to the MIMETypeRegistry
- Find encode.h as well in FindWebP.cmake

Is that the right path? I would happily implement this if so.

Also, is this feature relevant? I couldn't find the requirement on W3C and I think right now only Chrome implements it.
Comment 1 Zhaolin Yu 2018-04-11 21:44:47 PDT
I believe this is duplicate of https://bugs.webkit.org/show_bug.cgi?id=125499.
Comment 2 Carlos Bentzen 2018-04-11 21:57:56 PDT
Yes. It is the same test failing. However, I mentioned here specifically the WPE port.

It did it because the image encoding code is different from other ports. For example, for GTK it is implemented in Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp, relying on GdkPixBuf.

As this code isn't shared between ports I opened this one for a possible implementation only for WPE.

For GTK it could be added a fallback to reuse the implementation intended here using libwebp in the special case of WebP images.
Comment 3 Carlos Bentzen 2018-04-11 21:59:01 PDT
> It did it

typo: I did it