def set_texture_from_resource(self, resource):
    if (not resource):
        self._clear_core_image()
        return
    source = resource_find(resource)
    if (not source):
        Logger.error(('Image: Not found <%s>' % resource))
        self._clear_core_image()
        return
    if self._coreimage:
        self._coreimage.unbind(on_texture=self._on_tex_change)
    try:
        self._coreimage = image = CoreImage(source, mipmap=self.mipmap, anim_delay=self.anim_delay, keep_data=self.keep_data, nocache=self.nocache)
    except Exception:
        Logger.error(('Image: Error loading <%s>' % resource))
        self._clear_core_image()
        image = self._coreimage
    if image:
        image.bind(on_texture=self._on_tex_change)
        self.texture = image.texture
def set_texture_from_resource(self, resource):
    if (not resource):
        self._clear_core_image()
        return
    source = resource_find(resource)
    if (not source):
        Logger.error(('Image: Not found <%s>' % resource))
        self._clear_core_image()
        return
    if self._coreimage:
        self._coreimage.unbind(on_texture=self._on_tex_change)
    try:
        self._coreimage = image = CoreImage(source, mipmap=self.mipmap, anim_delay=self.anim_delay, keep_data=self.keep_data, nocache=self.nocache)
    except Exception:
        Logger.error(('Image: Error loading <%s>' % resource))
        self._clear_core_image()
        image = self._coreimage
    if image:
        image.bind(on_texture=self._on_tex_change)
        self.texture = image.texture