title: How Can I decode and encode from Webp using Libwebp?
body: <p>Im having trouble encoding and decoding from webp using libwebp in c++.
  I built this test application which takes webp file i created (which looks fine in chrome), and tried decoding it to rgb, and back to webp, just to understand how to use it, and the output is wrong:</p>
  
  <pre><code>//Code before reads the webp file, and assigning it to a uint8_t buffer called "pic" ///
  
  WebPConfig config;
  ASSERT(WebConfigIit(&amp;config) == TRUE)
  
  int width=0 height =0;
  uint8_t * rgb = WebPDecodeRGB(pic, size, &amp;width, &amp;height)
  ASSERT (rgb != NULL)
  // At this point the width and the height is valid, and the rgb is assigned.
  
  uint8_t* originalPic = null;
  size_t size = WebPEncodeRGB(rgb, width, height, height, &amp;originalPic);
  // Didn't quite know what to put in the stride param.. 
  
  /// Code after saves the originalPic buffer to a file ////
  </code></pre>
  
  <p>As you can see, all i tried to do is manage to encode and decode the webp, and trying to save it back to a file, but as i try to open the file, it looks corrupted.</p>
  
  <p>Can you please help me figure out what the problem is? 
  more over, i would be happy to know some more about the stride param, and about the rgb format, and how to convert pictures to it to check if my code works.</p>
  
  <p>Thanks alot!</p>