title: Python Imaging: load jpeg from memory
body: <p>The problem is to load jpeg-encoded image from memory.</p>
  
  <p>I receive a string from socket:</p>
  
  <pre><code>jpgdata = self.rfile.read(sz)
  </code></pre>
  
  <p>and I know that this is jpeg-encoded image.</p>
  
  <p>I need to decode it.
  The most stupid solution is:</p>
  
  <pre><code>o = open("Output/1.jpg","wb")
  o.write(jpgdata)
  o.close()
  dt = Image.open("Output/1.jpg")
  </code></pre>
  
  <p>The question is how to do the same thing in-memory?</p>