From 7754f3e87f4349cf31b11283f336b7389652b190 Mon Sep 17 00:00:00 2001 From: "wonguk.jeong" Date: Sun, 29 Jun 2014 15:04:03 +0200 Subject: [PATCH] evas: fix jpeg loader rotation by metadata (exif) 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 --- .../evas/loaders/jpeg/evas_image_load_jpeg.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/modules/evas/loaders/jpeg/evas_image_load_jpeg.c b/src/modules/evas/loaders/jpeg/evas_image_load_jpeg.c index e2fd97ca73..0ec2c85c00 100644 --- a/src/modules/evas/loaders/jpeg/evas_image_load_jpeg.c +++ b/src/modules/evas/loaders/jpeg/evas_image_load_jpeg.c @@ -1076,8 +1076,8 @@ done: 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; @@ -1107,26 +1107,26 @@ done: 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; }