From: wonguk.jeong Date: Sun, 29 Jun 2014 13:04:03 +0000 (+0200) Subject: evas: fix jpeg loader rotation by metadata (exif) X-Git-Tag: upstream/1.10.0+1149+ga3a15b1~459 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7754f3e87f4349cf31b11283f336b7389652b190;p=platform%2Fupstream%2Fefl.git 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 --- 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 e2fd97c..0ec2c85 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; }