<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>183257</bug_id>
          
          <creation_ts>2018-03-01 13:24:49 -0800</creation_ts>
          <short_desc>[WPE] Add support for WebP encoding in HTMLCanvasElement</short_desc>
          <delta_ts>2019-08-25 18:57:18 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WPE WebKit</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Bentzen">cadubentzen</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>franklinyu</cc>
    
    <cc>me</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1403012</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Bentzen">cadubentzen</who>
    <bug_when>2018-03-01 13:24:49 -0800</bug_when>
    <thetext>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&apos;t find the requirement on W3C and I think right now only Chrome implements it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1413925</commentid>
    <comment_count>1</comment_count>
    <who name="Zhaolin Yu">franklinyu</who>
    <bug_when>2018-04-11 21:44:47 -0700</bug_when>
    <thetext>I believe this is duplicate of https://bugs.webkit.org/show_bug.cgi?id=125499.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1413926</commentid>
    <comment_count>2</comment_count>
    <who name="Carlos Bentzen">cadubentzen</who>
    <bug_when>2018-04-11 21:57:56 -0700</bug_when>
    <thetext>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&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1413927</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Bentzen">cadubentzen</who>
    <bug_when>2018-04-11 21:59:01 -0700</bug_when>
    <thetext>&gt; It did it

typo: I did it</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>