title: cv::imwrite could not find a writer for the specified extension
body: <p>The following command causes an exception.</p>
  
  <pre><code>cv::imwrite("test.jpg", diffImg);
  </code></pre>
  
  <p>I also tried numerous variations on this, including absolute paths and PNG export. Here's the error:</p>
  
  <blockquote>
    <p>Exception at 0x75abd36f, code: 0xe06d7363: C++ exception, flags=0x1
    (execution cannot be continued) in opencv_core231!cv::error</p>
    
    <p>C:\slave\WinInstallerMegaPack\src\opencv\modules\highgui\src\loadsave.cpp:276:
    error: (-2) could not find a writer for the specified extension</p>
  </blockquote>
  
  <p>According to <a href="https://stackoverflow.com/questions/6923296/opencv-imwrite-2-2-causes-exception-with-message-opencv-error-unspecified-erro">this related thread</a> my current OpenCV installation doesn't support the image formats I tried. But I merely downloaded the <a href="http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.3.1/" rel="noreferrer">precompiled Windows framework</a> like their site suggested.</p>
  
  <p>How can I get JPG export working?</p>