summaryrefslogtreecommitdiff
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:59:57 +0900
commit6bb6552d979bf3ecce7eba0a3505c877a1138bb2 (patch)
tree16d21f5ca41b7f7964aa26bd062ecbb1ab796e7e
parenta3cc5810cbc6878e9aa458688d0fb8e397fd4d9e (diff)
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
-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,
875 unsigned char orientation[2]; 875 unsigned char orientation[2];
876 ExifByteAlign byte_align; 876 ExifByteAlign byte_align;
877 unsigned int num_directory = 0; 877 unsigned int num_directory = 0;
878 unsigned int ifd_offset = 10; //IFD offset start at 10th byte
878 unsigned int i, j; 879 unsigned int i, j;
879 int direction; 880 int direction;
880 unsigned int data_size = 0; 881 unsigned int data_size = 0;
@@ -896,19 +897,23 @@ _get_orientation_app1(const unsigned char *map,
896 return EINA_TRUE; 897 return EINA_TRUE;
897 } 898 }
898 899
899 /* 2. get 10&11 byte get info of "II(0x4949)" or "MM(0x4d4d)" */ 900 /* 2. get 14th byte get info for IFD offset */
900 /* 3. get [18]&[19] get directory entry # */ 901 /* 3. get 10&11 byte get info of "II(0x4949)" or "MM(0x4d4d)" */
902 /* 4. get directory entry IFD */
903
904 ifd_offset += *(buf + 14);
905
901 if (!memcmp(buf + 10, MM, sizeof(MM))) 906 if (!memcmp(buf + 10, MM, sizeof(MM)))
902 { 907 {
903 byte_align = EXIF_BYTE_ALIGN_MM; 908 byte_align = EXIF_BYTE_ALIGN_MM;
904 num_directory = ((*(buf + 18) << 8) + *(buf + 19)); 909 num_directory = ((*(buf + ifd_offset) << 8) + *(buf + ifd_offset + 1));
905 orientation[0] = 0x01; 910 orientation[0] = 0x01;
906 orientation[1] = 0x12; 911 orientation[1] = 0x12;
907 } 912 }
908 else if (!memcmp(buf + 10, II, sizeof(II))) 913 else if (!memcmp(buf + 10, II, sizeof(II)))
909 { 914 {
910 byte_align = EXIF_BYTE_ALIGN_II; 915 byte_align = EXIF_BYTE_ALIGN_II;
911 num_directory = ((*(buf + 19) << 8) + *(buf + 18)); 916 num_directory = ((*(buf + ifd_offset + 1) << 8) + *(buf + ifd_offset));
912 orientation[0] = 0x12; 917 orientation[0] = 0x12;
913 orientation[1] = 0x01; 918 orientation[1] = 0x01;
914 } 919 }
@@ -919,7 +924,7 @@ _get_orientation_app1(const unsigned char *map,
919 if ((*position + (12 * num_directory + 20)) > fsize) 924 if ((*position + (12 * num_directory + 20)) > fsize)
920 return EINA_FALSE; 925 return EINA_FALSE;
921 926
922 buf = app1_head + 20; 927 buf = app1_head + ifd_offset + 2;
923 928
924 j = 0; 929 j = 0;
925 930