hermet pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c4ff2cde25a1396eaccb7591175b7675aaa9bd9e

commit c4ff2cde25a1396eaccb7591175b7675aaa9bd9e
Author: Hermet Park <[email protected]>
Date:   Wed Aug 8 15:52:37 2018 +0900

    elementary image: don't calc size using empty ones.
    
    Summary:
    Zero-sized image occasionally happens.
    That occurs insane img/clipper region.
    
    bj size => (w, h) then resize => (0, 0)
    file_set(xx.jpg) then file_set (NULL)
    
    Because of this, region could be flickered during prev/cur preloading 
images.
    
    @fix
    
    Reviewers: #committers, zmike
    
    Subscribers: #reviewers, cedric, #committers, zmike
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D6725
---
 src/lib/elementary/efl_ui_image.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/lib/elementary/efl_ui_image.c 
b/src/lib/elementary/efl_ui_image.c
index ca1dbb0ec5..b6a61e5ac8 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -182,6 +182,15 @@ _image_sizing_eval(Efl_Ui_Image_Data *sd, Evas_Object *img)
 
         //1. Get the original image size (iw x ih)
         evas_object_image_size_get(img, &iw, &ih);
+
+        //Exception Case
+        if ((iw == 0) || (ih == 0) || (sd->img_w == 0) || (sd->img_h == 0))
+          {
+             evas_object_resize(img, 0, 0);
+             evas_object_resize(sd->hit_rect, 0, 0);
+             return;
+          }
+
         iw = ((double)iw) * sd->scale;
         ih = ((double)ih) * sd->scale;
 

-- 


Reply via email to