title: How Do I Encode/Decode Webp Format in Memory using Opencv on Python?
body: <p>I'm trying to load 90,000 images in <code>webp</code> format in memory, and decode as needed for speed.
  However, I can't get the following test code to decode the encoded format.
  I'd appreciate any pointer.</p>
  
  <pre class="lang-py prettyprint-override"><code>img = cv2.imread(file)
  retval, buf = cv2.imencode(".webp", img, [cv2.IMWRITE_WEBP_QUALITY, 100])
  img = cv2.imdecode(buf, 1)
  </code></pre>
  
  <blockquote>
    <p>imdecode_(''): can't read data: OpenCV(4.1.0) /io/opencv/modules/imgcodecs/src/grfmt_webp.cpp:164: error: (-215:Assertion failed) data.rows == 1 in function 'readData'</p>
  </blockquote>