def image_from_data(self, data, filename=None):
        try:
            return wx.ImageFromStream(StringIO(data))
        except:
            # wx.ImageFromStream is only in wx 2.8 or later(?)
            if filename is Undefined:
                return None

        handle = None
        if filename is None:
            # If there is currently no way in wx to create an image from data,
            # we have write it out to a temporary file and then read it back in:
            handle, filename = tempfile.mkstemp()

        # Write it out...
        tf = open(filename, 'wb')
        tf.write(data)
        tf.close()

        # ... and read it back in!  Lovely 8^()
        image = wx.Image(filename, wx.BITMAP_TYPE_ANY)

        # Remove the temporary file.
        if handle is not None:
            os.close(handle)
            os.unlink(filename)

        return image

#### EOF ######################################################################
This function returns the schema for a given resource_type
dataset/ETHPy150Open enthought/pyface/pyface/ui/wx/resource_manager.py/PyfaceResourceFactory.image_from_data--crossover with--dataset/ETHPy150Open ooici/pyon/pyon/ion/resource.py/get_object_schema