xref: /PHP-7.3/ext/exif/tests/bug50845.phpt (revision 1ab5a1b4)
1--TEST--
2Bug #50845 (exif_read_data() returns corrupted exif headers)
3--SKIPIF--
4<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
5--FILE--
6<?php
7$infile = dirname(__FILE__).'/bug50845.jpg';
8var_dump(exif_read_data($infile));
9--EXPECTF--
10array(44) {
11  ["FileName"]=>
12  string(12) "bug50845.jpg"
13  ["FileDateTime"]=>
14  int(%d)
15  ["FileSize"]=>
16  int(803603)
17  ["FileType"]=>
18  int(2)
19  ["MimeType"]=>
20  string(10) "image/jpeg"
21  ["SectionsFound"]=>
22  string(30) "ANY_TAG, IFD0, THUMBNAIL, EXIF"
23  ["COMPUTED"]=>
24  array(9) {
25    ["html"]=>
26    string(26) "width="5472" height="3648""
27    ["Height"]=>
28    int(3648)
29    ["Width"]=>
30    int(5472)
31    ["IsColor"]=>
32    int(1)
33    ["ByteOrderMotorola"]=>
34    int(0)
35    ["ApertureFNumber"]=>
36    string(5) "f/7.1"
37    ["Copyright"]=>
38    string(13) "Public Domain"
39    ["Thumbnail.FileType"]=>
40    int(2)
41    ["Thumbnail.MimeType"]=>
42    string(10) "image/jpeg"
43  }
44  ["ImageDescription"]=>
45  string(295) "A U.S. Marine Corps MV-22 Osprey lands on the USS Whidbey Island (LSD-41), May 5, 2016. The vehicles were loaded to support a theater security cooperation event as a part of a MEU readiness exercise. (U.S. Marine Corps photo by Lance Cpl. Koby I. Saunders/22 Marine Expeditionary Unit/ Released)"
46  ["Make"]=>
47  string(5) "Canon"
48  ["Model"]=>
49  string(22) "Canon EOS-1D X Mark II"
50  ["Orientation"]=>
51  int(1)
52  ["XResolution"]=>
53  string(5) "240/1"
54  ["YResolution"]=>
55  string(5) "240/1"
56  ["ResolutionUnit"]=>
57  int(2)
58  ["Artist"]=>
59  string(24) "Lance Cpl. Koby Saunders"
60  ["Copyright"]=>
61  string(13) "Public Domain"
62  ["Exif_IFD_Pointer"]=>
63  int(12572)
64  ["THUMBNAIL"]=>
65  array(6) {
66    ["Compression"]=>
67    int(6)
68    ["XResolution"]=>
69    string(5) "240/1"
70    ["YResolution"]=>
71    string(5) "240/1"
72    ["ResolutionUnit"]=>
73    int(2)
74    ["JPEGInterchangeFormat"]=>
75    int(860)
76    ["JPEGInterchangeFormatLength"]=>
77    int(11204)
78  }
79  ["ExposureTime"]=>
80  string(5) "1/200"
81  ["FNumber"]=>
82  string(5) "71/10"
83  ["ExposureProgram"]=>
84  int(1)
85  ["ISOSpeedRatings"]=>
86  int(100)
87  ["UndefinedTag:0x8830"]=>
88  int(2)
89  ["UndefinedTag:0x8832"]=>
90  int(100)
91  ["ExifVersion"]=>
92  string(4) "0230"
93  ["ShutterSpeedValue"]=>
94  string(15) "7643856/1000000"
95  ["ApertureValue"]=>
96  string(15) "5655638/1000000"
97  ["ExposureBiasValue"]=>
98  string(3) "0/1"
99  ["MaxApertureValue"]=>
100  string(3) "4/1"
101  ["MeteringMode"]=>
102  int(5)
103  ["Flash"]=>
104  int(16)
105  ["FocalLength"]=>
106  string(4) "24/1"
107  ["ColorSpace"]=>
108  int(65535)
109  ["FocalPlaneXResolution"]=>
110  string(12) "5472000/1438"
111  ["FocalPlaneYResolution"]=>
112  string(11) "3648000/958"
113  ["FocalPlaneResolutionUnit"]=>
114  int(2)
115  ["CustomRendered"]=>
116  int(0)
117  ["ExposureMode"]=>
118  int(1)
119  ["WhiteBalance"]=>
120  int(0)
121  ["SceneCaptureType"]=>
122  int(0)
123  ["UndefinedTag:0xA431"]=>
124  string(12) "002099000358"
125  ["UndefinedTag:0xA432"]=>
126  array(4) {
127    [0]=>
128    string(4) "24/1"
129    [1]=>
130    string(5) "105/1"
131    [2]=>
132    string(3) "0/0"
133    [3]=>
134    string(3) "0/0"
135  }
136  ["UndefinedTag:0xA434"]=>
137  string(22) "EF24-105mm f/4L IS USM"
138  ["UndefinedTag:0xA435"]=>
139  string(10) "000044bc4c"
140}
141