Summary:
90 or 270 degree rotation is not working properly
width should be regarded as height, and vice versa.
if this patch and D1082 were commited, rotation from metadata will be working properly by using evas_object_image_load_orientation_set()
@fix
Test Plan: add image object and invoke evas_object_image_load_orientation_set() -> load file with orientation metadata -> check whether image is rotated properly or not
Reviewers: raster, cedric, jpeg
CC: seoz, cedric
Differential Revision: https://phab.enlightenment.org/D1084
Signed-off-by: Cedric Bail <cedric.bail@free.fr>
if (prop->rotated)
{
- DATA32 *data1, *data2, *to, *from;
- int lx, ly, lw, lh, hw;
+ DATA32 *data1, *data2, *to, *from;
+ int lx, ly, lw, lh, hw;
lw = w;
lh = h;
if (degree == 90)
{
- to = data1 + lw - 1;
+ to = data1 + lh - 1;
hw = -hw - 1;
}
else if (degree == 270)
{
- to = data1 + hw - lw;
- lw = -lw;
+ to = data1 + hw - lh;
+ lh = -lh;
hw = hw + 1;
}
if (to)
{
from = data2;
- for (lx = w; --lx >= 0;)
+ for (lx = h; --lx >= 0;)
{
- for (ly = h; --ly >= 0;)
+ for (ly = w; --ly >= 0;)
{
*to = *from;
from++;
- to += lw;
+ to += lh;
}
to += hw;
}