evas: Fix region test in jpeg load with region + zoom 48/87048/3
authorJean-Philippe Andre <jp.andre@samsung.com>
Wed, 17 Aug 2016 07:45:16 +0000 (16:45 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Mon, 12 Sep 2016 07:34:09 +0000 (00:34 -0700)
The previous commit exposed an issue with the region test
does not take into account the scale down factor.

Not a @fix in itself, as it depends on the previous patch.

Change-Id: I0fd33338496b0ce36e8ecbc4ba86dd2b619ab280

src/lib/emile/emile_image.c

index fc799ce..d7b9561 100644 (file)
@@ -1562,6 +1562,13 @@ _emile_jpeg_head(Emile_Image *image,
                             prop->w, prop->h,
                             degree, prop->flipped);
           }
+        if (prop->scale > 1)
+          {
+             load_region_x /= prop->scale;
+             load_region_y /= prop->scale;
+             load_region_w /= prop->scale;
+             load_region_h /= prop->scale;
+          }
         RECTS_CLIP_TO_RECT(load_region_x, load_region_y,
                            load_region_w, load_region_h,
                            0, 0, prop->w, prop->h);