title: Load image file from bytes into PyQt4.QtGui.QImage
body: <p>I'm trying to load an image (a jpeg in that case from bytes, as it is downloaded from web content).
  I've already consulted some posts (for ex. <a href="https://stackoverflow.com/questions/47289884/how-to-convert-qimageqpixmap-to-pil-image-in-python-3#answer-47290541">1</a> &amp; <a href="https://stackoverflow.com/questions/17851524/qimage-from-file-content">2</a>), but for some reason I can't reproduce those answers, though JPEG is a wholy implemented format by PyQT4 as stated in the <a href="http://pyqt.sourceforge.net/Docs/PyQt4/qimage.html#reading-and-writing-image-files" rel="nofollow noreferrer">doc</a>.</p>
  
  <p>Let's say the picture to load in a QImage is this <a href="https://upload.wikimedia.org/wikipedia/commons/thumb/6/6f/OrteliusWorldMap.jpeg/800px-OrteliusWorldMap.jpeg" rel="nofollow noreferrer">one</a>. </p>
  
  <p>I'm first downloading picture using request (though I'm certain this isn't related to this particular problem - I put it here mainly for portability reasons...).</p>
  
  <pre><code>import requests
  r = requests.get(href, stream=True)
  pict_bytes = r.content
  </code></pre>
  
  <p>After that, I can check this image is 100% correct using PIL and io modules :</p>
  
  <pre><code>from PIL import Image
  import io
  image = Image.open(io.BytesIO(pict_bytes))
  image.show()
  image.save('./test.jpeg')
  </code></pre>
  
  <p>It gets confusing afterwards, while trying to convert bytes to QImage :</p>
  
  <pre><code>from PyQt4 import QtGui
  qim = QtGui.QImage()
  qim.loadFromData(pict_bytes)
  </code></pre>
  
  <p>qim.loadFromData(..) returns False whatever the picture I chose, which I can't understand regarding to the function's description in the <a href="http://pyqt.sourceforge.net/Docs/PyQt4/qimage.html#loadFromData" rel="nofollow noreferrer">doc</a>. I also checked directly from the file :</p>
  
  <pre><code>with open('./test.jpeg', 'rb') as f:
      content = f.read()
  qim.loadFromData(content)
  </code></pre>
  
  <p>Is there something obvious that I missed, or is this some strange comportment of PyQt4 with python 3 ? I would be grateful for your insights...</p>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <p>I'm starting to believe there is some bug here (responses are all coherent with what I had already tried,  in one way or another). Something doesn't feel quite right with the PyQt4 QImage (as well as QPixmap I suspect).</p>
  
  <p>I'm currently using Windows 10 (and used Windows 2008 Server at the office), Winpython 3.6 x64, with PyQt4 4.11.4 installed from the <a href="https://www.lfd.uci.edu/~gohlke/pythonlibs/" rel="nofollow noreferrer">unofficial depositery</a> of  Christoph Gohlke.</p>