summaryrefslogtreecommitdiff
path: root/src/lib/emile
diff options
context:
space:
mode:
authorjiin.moon <jiin.moon@samsung.com>2015-08-29 00:47:43 +0900
committerChunEon Park <hermet@hermet.pe.kr>2015-08-29 00:47:43 +0900
commit1073774d8ea3946a1c0e680d4b5f701f279218e5 (patch)
treeae7a9883331e7b4837ea7dabd5f0d699ded62854 /src/lib/emile
parentc850cc0d80b754be851576083eba27a72b58b9f2 (diff)
downloadefl-1073774d8ea3946a1c0e680d4b5f701f279218e5.tar.gz
emile: fix can not parsing the EXIF info of the jpeg file which has IFD offset
Summary: IFD offset of jpeg is not fixed. But emile support only 0x8 on now Reviewers: jypark, cedric, Hermet Reviewed By: Hermet Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3000
Diffstat (limited to 'src/lib/emile')
-rw-r--r--src/lib/emile/emile_image.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/emile/emile_image.c b/src/lib/emile/emile_image.c
index aed1ae8738..b116fec8f0 100644
--- a/src/lib/emile/emile_image.c
+++ b/src/lib/emile/emile_image.c
@@ -875,6 +875,7 @@ _get_orientation_app1(const unsigned char *map,
unsigned char orientation[2];
ExifByteAlign byte_align;
unsigned int num_directory = 0;
+ unsigned int ifd_offset = 10; //IFD offset start at 10th byte
unsigned int i, j;
int direction;
unsigned int data_size = 0;
@@ -896,19 +897,23 @@ _get_orientation_app1(const unsigned char *map,
return EINA_TRUE;
}
- /* 2. get 10&11 byte get info of "II(0x4949)" or "MM(0x4d4d)" */
- /* 3. get [18]&[19] get directory entry # */
+ /* 2. get 14th byte get info for IFD offset */
+ /* 3. get 10&11 byte get info of "II(0x4949)" or "MM(0x4d4d)" */
+ /* 4. get directory entry IFD */
+
+ ifd_offset += *(buf + 14);
+
if (!memcmp(buf + 10, MM, sizeof(MM)))
{
byte_align = EXIF_BYTE_ALIGN_MM;
- num_directory = ((*(buf + 18) << 8) + *(buf + 19));
+ num_directory = ((*(buf + ifd_offset) << 8) + *(buf + ifd_offset + 1));
orientation[0] = 0x01;
orientation[1] = 0x12;
}
else if (!memcmp(buf + 10, II, sizeof(II)))
{
byte_align = EXIF_BYTE_ALIGN_II;
- num_directory = ((*(buf + 19) << 8) + *(buf + 18));
+ num_directory = ((*(buf + ifd_offset + 1) << 8) + *(buf + ifd_offset));
orientation[0] = 0x12;
orientation[1] = 0x01;
}
@@ -919,7 +924,7 @@ _get_orientation_app1(const unsigned char *map,
if ((*position + (12 * num_directory + 20)) > fsize)
return EINA_FALSE;
- buf = app1_head + 20;
+ buf = app1_head + ifd_offset + 2;
j = 0;