title: Gtk+3 Gdk Pixbuf.new_from_data gives "Segmentation fault (core dumped)" error 139
body: <p>In my application I have a GtkImage that must show the processed image from a choosed file. So, in the handlers section I have:</p>
  
  <pre><code>import numpy as np
  from PIL import Image , ImageDraw
  from gi.repository import Gtk,  GdkPixbuf
  . . .
  . . .
  def on_fitchooserdialog_response(self, menuitem, data=None):
      if data == 1:  
          self.fitlist = self.fitchooser.get_filenames()
          # get data from 1st file:
          _, self.data = Getdata(self.fitlist[0])
          # convert from Fits to 2D array:
          pngarray = Fit2png(self.data)
          # rescale:
          size = tuple(x/2 for x in pngarray.shape)
          im = Image.fromarray(pngarray)
          im.thumbnail((size[1],size[0]), Image.BICUBIC)
  </code></pre>
  
  <p>Up to here, all is OK. If we do:</p>
  
  <pre><code>       im.save("../tmp/tmp.png")
         pixbuf = GdkPixbuf.Pixbuf.new_from_file('../tmp/tmp.png')
         self.imagen.set_property("pixbuf", pixbuf)
  </code></pre>
  
  <p>the expected image is pasted on the GtkImage widget.
  But that is the ugly way, isnt it?</p>
  
  <p>So Im trying:</p>
  
  <pre><code>im = im.convert("RGB")
  arr = np.array(im).flatten()
  pixbuf = GdkPixbuf.Pixbuf.new_from_data(arr,
        GdkPixbuf.Colorspace.RGB, False, 8, size[1], size[0], 3*size[1])
  </code></pre>
  
  <p>But the result is "Error 139, Segmentation fault (core dumped)"</p>
  
  <p>What am I missing?</p>