xref: /PHP-7.0/ext/exif/tests/exif001.phpt (revision 25641a7e)
1--TEST--
2Check for exif_read_data
3--SKIPIF--
4<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
5--INI--
6output_handler=
7zlib.output_compression=0
8--FILE--
9<?php
10/*
11  test1.jpg is a 1*1 image that does not contain any Exif/Comment information
12  test2.jpg is the same image but contains Exif/Comment information and a
13            copy of test1.jpg as a thumbnail.
14*/
15var_dump(exif_read_data(dirname(__FILE__).'/test2.jpg','',true,false));
16?>
17--EXPECTF--
18array(5) {
19  ["FILE"]=>
20  array(6) {
21    ["FileName"]=>
22    string(9) "test2.jpg"
23    ["FileDateTime"]=>
24    int(%d)
25    ["FileSize"]=>
26    int(1240)
27    ["FileType"]=>
28    int(2)
29    ["MimeType"]=>
30    string(10) "image/jpeg"
31    ["SectionsFound"]=>
32    string(33) "ANY_TAG, IFD0, THUMBNAIL, COMMENT"
33  }
34  ["COMPUTED"]=>
35  array(12) {
36    ["html"]=>
37    string(20) "width="1" height="1""
38    ["Height"]=>
39    int(1)
40    ["Width"]=>
41    int(1)
42    ["IsColor"]=>
43    int(1)
44    ["ByteOrderMotorola"]=>
45    int(1)
46    ["UserComment"]=>
47    string(16) "Exif test image."
48    ["UserCommentEncoding"]=>
49    string(5) "ASCII"
50    ["Copyright"]=>
51    string(41) "Photo (c) M.Boerger, Edited by M.Boerger."
52    ["Copyright.Photographer"]=>
53    string(19) "Photo (c) M.Boerger"
54    ["Copyright.Editor"]=>
55    string(20) "Edited by M.Boerger."
56    ["Thumbnail.FileType"]=>
57    int(2)
58    ["Thumbnail.MimeType"]=>
59    string(10) "image/jpeg"
60  }
61  ["IFD0"]=>
62  array(2) {
63    ["Copyright"]=>
64    string(19) "Photo (c) M.Boerger"
65    ["UserComment"]=>
66    string(5) "ASCII"
67  }
68  ["THUMBNAIL"]=>
69  array(2) {
70    ["JPEGInterchangeFormat"]=>
71    int(134)
72    ["JPEGInterchangeFormatLength"]=>
73    int(523)
74  }
75  ["COMMENT"]=>
76  array(3) {
77    [0]=>
78    string(11) "Comment #1."
79    [1]=>
80    string(11) "Comment #2."
81    [2]=>
82    string(13) "Comment #3end"
83  }
84}