jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=7bae58b315e4629a19a06fde7523b6a05d31faaf

commit 7bae58b315e4629a19a06fde7523b6a05d31faaf
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Tue Oct 1 18:05:21 2013 +0900

    elm_image: Fix preload for normal files
    
    grmbl, elm_image must explicitely start preload or the
    image will stay blank if evas_object_show() is called before
    elm_image_file_set().
---
 src/lib/elm_image.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c
index 8d2d17d..5a5aecc 100644
--- a/src/lib/elm_image.c
+++ b/src/lib/elm_image.c
@@ -740,8 +740,12 @@ _elm_image_smart_memfile_set(Eo *obj, void *_pd, va_list 
*list)
    evas_object_image_memfile_set
      (sd->img, (void *)img, size, (char *)format, (char *)key);
 
-   sd->preloading = EINA_TRUE;
-   evas_object_image_preload(sd->img, EINA_FALSE);
+   if (evas_object_visible_get(obj))
+     {
+        sd->preloading = EINA_TRUE;
+        evas_object_image_preload(sd->img, EINA_FALSE);
+     }
+
    if (evas_object_image_load_error_get(sd->img) != EVAS_LOAD_ERROR_NONE)
      {
         ERR("Things are going bad for some random " FMT_SIZE_T
@@ -845,6 +849,12 @@ _elm_image_smart_internal_file_set(Eo *obj, 
Elm_Image_Smart_Data *sd,
 
    evas_object_hide(sd->img);
 
+   if (evas_object_visible_get(obj))
+     {
+        sd->preloading = EINA_TRUE;
+        evas_object_image_preload(sd->img, EINA_FALSE);
+     }
+
    if (evas_object_image_load_error_get(sd->img) != EVAS_LOAD_ERROR_NONE)
      {
         ERR("Things are going bad for '%s' (%p)", file, sd->img);
@@ -887,8 +897,8 @@ _elm_image_smart_download_done(void *data, Elm_Url *url 
EINA_UNUSED, Eina_Binbuf
      {
         if (evas_object_visible_get(obj))
           {
-             Evas_Object *eobj = elm_image_object_get(obj);
-             evas_object_image_preload(eobj, EINA_FALSE);
+             sd->preloading = EINA_TRUE;
+             evas_object_image_preload(sd->img, EINA_FALSE);
           }
 
         evas_object_smart_callback_call(obj, SIG_DOWNLOAD_DONE, NULL);

-- 


Reply via email to