]> granicus.if.org Git - php/commitdiff
Fixed bug #72682 (exif_read_data() fails to read all data for some images)
authorKalle Sommer Nielsen <kalle@php.net>
Wed, 3 Aug 2016 15:33:18 +0000 (17:33 +0200)
committerKalle Sommer Nielsen <kalle@php.net>
Wed, 3 Aug 2016 15:33:18 +0000 (17:33 +0200)
This is fixed by adding DJI signatures to the MAKERNOTE and its supported tags, list is credits to ExifTool documentation.

NEWS
ext/exif/exif.c

diff --git a/NEWS b/NEWS
index 71cc1fbe687c12edf91428aea95ceb7866ef8e9d..e7e53073cc1ded419c19847c9f8f8ab0940c07a1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ PHP                                                                        NEWS
   . Changed the way that EXIF processes MAKERNOTE data to not stop parsing 
     in case of an unknown signature. (Kalle, Remi)
   . Fixed bug #72735 (Samsung picture thumb not read (zero size)). (Kalle)
+  . Fixed bug #72682 (exif_read_data() fails to read all data for some 
+    images). (Kalle)
   . Fixed Redhat bug #1362571 (PHP not returning full results for 
     exif_read_data function). (Kalle)
 
index 50db48df7696cab6a071307770b58d12d1d7b46f..b340b51fe2c5bbe97c707a0617f6d6c781af52ba 100644 (file)
@@ -1095,6 +1095,20 @@ static tag_info_array tag_table_VND_PANASONIC = {
   TAG_TABLE_END
 };
 
+static tag_info_array tag_table_VND_DJI = {
+  { 0x0001, "Make"}, 
+  { 0x0003, "SpeedX"}, 
+  { 0x0004, "SpeedY"}, 
+  { 0x0005, "SpeedZ"}, 
+  { 0x0006, "Pitch"}, 
+  { 0x0007, "Yaw"}, 
+  { 0x0008, "Roll"}, 
+  { 0x0009, "CameraPitch"}, 
+  { 0x000a, "CameraYaw"}, 
+  { 0x000b, "CameraRoll"}, 
+  TAG_TABLE_END
+};
+
 typedef enum mn_byte_order_t {
        MN_ORDER_INTEL    = 0,
        MN_ORDER_MOTOROLA = 1,
@@ -1127,7 +1141,8 @@ static const maker_note_type maker_note_array[] = {
   { tag_table_VND_NIKON_990, "NIKON",                   NULL,  NULL,                       0,  0,  MN_ORDER_NORMAL,   MN_OFFSET_NORMAL},
   { tag_table_VND_OLYMPUS,   "OLYMPUS OPTICAL CO.,LTD", NULL,  "OLYMP\x00\x01\x00",        8,  8,  MN_ORDER_NORMAL,   MN_OFFSET_NORMAL},
   { tag_table_VND_SAMSUNG,   "SAMSUNG",                 NULL, NULL,                        0,  0,  MN_ORDER_NORMAL,   MN_OFFSET_NORMAL}, 
-  { tag_table_VND_PANASONIC, "Panasonic",               NULL, "Panasonic\x00\x00\x00",     12, 12, MN_ORDER_NORMAL,   MN_OFFSET_NORMAL}
+  { tag_table_VND_PANASONIC, "Panasonic",               NULL, "Panasonic\x00\x00\x00",     12, 12, MN_ORDER_NORMAL,   MN_OFFSET_NORMAL}, 
+  { tag_table_VND_DJI,       "DJI",                     NULL, NULL,                        0, 0,   MN_ORDER_NORMAL,   MN_OFFSET_NORMAL}
 };
 /* }}} */