title: Error during image decoding (imdecode)
body: <p>I use puthon 2.7, windows 7 and opencv 2.4.6. and I try to run the following code:</p>
  
  <p><a href="https://github.com/kyatou/python-opencv_tutorial/blob/master/08_image_encode_decode.py" rel="nofollow">https://github.com/kyatou/python-opencv_tutorial/blob/master/08_image_encode_decode.py</a></p>
  
  <pre><code>#import opencv library
  import cv2
  import sys
  import numpy
  
  argvs=sys.argv
  if (len(argvs) != 2):
   print 'Usage: # python %s imagefilename' % argvs[0]
   quit()
  
  imagefilename = argvs[1]
  try:
    img=cv2.imread(imagefilename, 1)
  except:
    print 'faild to load %s' % imagefilename
    quit()
  
  #encode to jpeg format
  #encode param image quality 0 to 100. default:95
  #if you want to shrink data size, choose low image quality.
  encode_param=[int(cv2.IMWRITE_JPEG_QUALITY),90]
  result,encimg=cv2.imencode('.jpg',img,encode_param)
  if False==result:
    print 'could not encode image!'
    quit()
  
  #decode from jpeg format
  decimg=cv2.imdecode(encimg,1)
  
  cv2.imshow('Source Image',img)
  cv2.imshow('Decoded image',decimg)
  cv2.waitKey(0)
  cv2.destroyAllWindows() 
  </code></pre>
  
  <p>I keep getting the following error:</p>
  
  <pre><code>encode_param=[int(cv2.IMWRITE_JPEG_QUALITY), 90]
  AttributeError: 'module' object has no attribute 'IMWRITE_JPEG_QUALITY'
  </code></pre>
  
  <p>I have tried a lot of things: reinstall opencv, convert cv2 to cv code and searched different forums but I keep getting this error. Am I missing something? Is there someone who can run this code without getting the error?</p>
  
  <p>BTW: Other opencv code (taking pictures from webcam) runs without problems....</p>
  
  <p>At the moment I save the image to a temp JPG file. Using the imencode function I want to create the jpg file in the memory.</p>
  
  <p>Thanks in advance and with best regards. </p>