title: Pillow (PIL) to QImage conversion -> python.exe has stopped working
body: <p>I want to load an Image with PIL, apply some filtering and then display the image on a GUI.</p>
  
  <p>I have written a little sample application:</p>
  
  <pre><code>from PyQt4 import QtCore, QtGui
  from PIL import Image, ImageQt
  
  class TwoDToThreeD(QtGui.QWidget):
  
      def __init__(self):
  
          QtGui.QWidget.__init__(self)
          layout = QtGui.QGridLayout()
  
          self.btnOpen = self.createButton("Open File", self.open)
  
          layout.addWidget(self.btnOpen, 4, 0)
  
          self.imageLabel = QtGui.QLabel()
          self.imageLabel.setBackgroundRole(QtGui.QPalette.Base)
          self.imageLabel.setSizePolicy(QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Ignored)
          self.imageLabel.setScaledContents(True)
  
          layout.addWidget(self.imageLabel, 0, 2, 4, 1)
          layout.setColumnStretch(1, 10)
          layout.setColumnStretch(2, 20)
  
          self.setLayout(layout)
  
      def createButton(self, text, member):
          button = QtGui.QPushButton(text)
          button.clicked.connect(member)
          return button
  
  
      def open(self):
          fileName = (QtGui.QFileDialog.getOpenFileName(self, "Open File", QtCore.QDir.currentPath()))
          if fileName:
              print (fileName)
              self.imgPil = Image.open(str(fileName))
  
              # print (PIL.VERSION)
  
              print (self.imgPil.format, self.imgPil.size, self.imgPil.mode)
              # imgPil.show()
              img_tmp = ImageQt.ImageQt(self.imgPil)
  
              image = QtGui.QImage(img_tmp)
  
              if image.isNull():
                  QtGui.QMessageBox.information(self, "Image Viewer", "Cannot load %s." % fileName)
                  return
  
              self.imageLabel.setPixmap(QtGui.QPixmap.fromImage(image))
  
  
  
  if __name__ == '__main__':
  
      import sys
  
      app = QtGui.QApplication(sys.argv)
      dialog = TwoDToThreeD()
      dialog.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>Loading a *.png works fine. But when I try to load a *.jpg python just crashes:</p>
  
  <pre><code>python.exe has stopped working
  A problem caused the program to stop working correctly.
  Windows will close the program and notify you if a solution is
  available.
  </code></pre>
  
  <p>I am on Windows 8.1 64Bit and tried the very same source with python 2.7 64bit, python 2.7 32bit and python 3.4 64bit.</p>
  
  <p>With all 3 versions I get the same result.</p>
  
  <p>Has anybody experienced similar problems or knows a solution?
  I can't even debug the code, since it runs til the "end" and then crashes :(</p>