summaryrefslogtreecommitdiff
path: root/src/lib/emile
diff options
context:
space:
mode:
authorjiin.moon <jiin.moon@samsung.com>2016-08-17 16:39:13 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-08-17 17:28:53 +0900
commitfecbcf8a905e30345d3454c9cdb665a6d7b098bc (patch)
tree8935497d41d8c6a37cdb70b04d29a4d20c65d4fb /src/lib/emile
parent3bdefaf31fde9801ce6702f850aac24bc2157842 (diff)
emile: region_set does not working in jpeg loader if scale_down has set
Summary: If both region and scale_down has set, ERR would be returned by loader of jpeg. @fix Test Plan: sample code Reviewers: raster, jypark, cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4200
Diffstat (limited to 'src/lib/emile')
-rw-r--r--src/lib/emile/emile_image.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/lib/emile/emile_image.c b/src/lib/emile/emile_image.c
index 5bad68ce36..5c12035fd7 100644
--- a/src/lib/emile/emile_image.c
+++ b/src/lib/emile/emile_image.c
@@ -1724,11 +1724,6 @@ _emile_jpeg_data(Emile_Image *image,
1724 { 1724 {
1725 region = 1; 1725 region = 1;
1726 1726
1727 opts_region.x = opts->region.x;
1728 opts_region.y = opts->region.y;
1729 opts_region.w = opts->region.w;
1730 opts_region.h = opts->region.h;
1731
1732 if (prop->rotated) 1727 if (prop->rotated)
1733 { 1728 {
1734 unsigned int load_region_x = 0, load_region_y = 0; 1729 unsigned int load_region_x = 0, load_region_y = 0;
@@ -1738,19 +1733,31 @@ _emile_jpeg_data(Emile_Image *image,
1738 load_region_y = opts->region.y; 1733 load_region_y = opts->region.y;
1739 load_region_w = opts->region.w; 1734 load_region_w = opts->region.w;
1740 load_region_h = opts->region.h; 1735 load_region_h = opts->region.h;
1741
1742 _rotate_region(&opts_region.x, &opts_region.y, 1736 _rotate_region(&opts_region.x, &opts_region.y,
1743 &opts_region.w, &opts_region.h, 1737 &opts_region.w, &opts_region.h,
1744 load_region_x, load_region_y, 1738 load_region_x, load_region_y,
1745 load_region_w, load_region_h, 1739 load_region_w, load_region_h,
1746 w, h, degree, prop->flipped); 1740 w, h, degree, prop->flipped);
1747 } 1741 }
1748#ifdef BUILD_LOADER_JPEG_REGION 1742
1749 cinfo.region_x = opts_region.x; 1743 /* scale value already applied when decompress.
1750 cinfo.region_y = opts_region.y; 1744 When access to decoded image, have to apply scale value to region value */
1751 cinfo.region_w = opts_region.w; 1745 if (prop->scale > 1)
1752 cinfo.region_h = opts_region.h; 1746 {
1753#endif 1747 opts_region.x = opts->region.x / prop->scale;
1748 opts_region.y = opts->region.y / prop->scale;
1749 opts_region.w = opts->region.w / prop->scale;
1750 opts_region.h = opts->region.h / prop->scale;
1751
1752 }
1753 else
1754 {
1755 opts_region.x = opts->region.x;
1756 opts_region.y = opts->region.y;
1757 opts_region.w = opts->region.w;
1758 opts_region.h = opts->region.h;
1759 }
1760
1754 } 1761 }
1755 if ((!region) && ((w != ie_w) || (h != ie_h))) 1762 if ((!region) && ((w != ie_w) || (h != ie_h)))
1756 { 1763 {