From c1ed8df7a074817d0b98ee61db1ccc53da7bde49 Mon Sep 17 00:00:00 2001 From: akshayaurora Date: Mon, 23 Jun 2014 20:43:14 +0530 Subject: [PATCH 1/2] uix:Image delayed importing of loader. Import it only when used --- kivy/uix/image.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kivy/uix/image.py b/kivy/uix/image.py index 2c3fcf86c..d2b868808 100644 --- a/kivy/uix/image.py +++ b/kivy/uix/image.py @@ -55,9 +55,10 @@ from kivy.core.image import Image as CoreImage from kivy.resources import resource_find from kivy.properties import StringProperty, ObjectProperty, ListProperty, \ AliasProperty, BooleanProperty, NumericProperty -from kivy.loader import Loader from kivy.logger import Logger +# delayed imports +Loader = None class Image(Widget): '''Image class, see module documentation for more information. @@ -303,6 +304,9 @@ class AsyncImage(Image): def __init__(self, **kwargs): self._coreimage = None super(AsyncImage, self).__init__(**kwargs) + global Loader + if not Loader: + from kivy.loader import Loader self.bind(source=self._load_source) if self.source: self._load_source() From 135be82655c1fa9023164c654be32e65cc9190ad Mon Sep 17 00:00:00 2001 From: akshayaurora Date: Mon, 23 Jun 2014 23:04:10 +0530 Subject: [PATCH 2/2] uix:Image: don't force Image texture to be created untill absolutely needed. --- kivy/core/image/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/kivy/core/image/__init__.py b/kivy/core/image/__init__.py index 7bbbc6baf..ea370c06b 100644 --- a/kivy/core/image/__init__.py +++ b/kivy/core/image/__init__.py @@ -445,8 +445,6 @@ class Image(EventDispatcher): else: raise Exception('Unable to load image type {0!r}'.format(arg)) - # check if the image hase sequences for animation in it - self._img_iterate() def remove_from_cache(self): '''Remove the Image from cache. This facilitates re-loading of