|
|
1.1 misho 1: --TEST--
2: GetImageSize()
3: --SKIPIF--
4: <?php
5: require_once('skipif_imagetype.inc');
6: ?>
7: --FILE--
8: <?php
9: // Note: SWC requires zlib
10: $dir = opendir(dirname(__FILE__)) or die('cannot open directory: '.dirname(__FILE__));
11: $result = array();
12: $files = array();
13: while (($file = readdir($dir)) !== FALSE) {
14: if (preg_match('/^test.+pix\./',$file) && $file != "test13pix.swf") {
15: $files[] = $file;
16: }
17: }
18: closedir($dir);
19: sort($files);
20: foreach($files as $file) {
21: $result[$file] = getimagesize(dirname(__FILE__)."/$file");
22: }
23: var_dump($result);
24: ?>
25: --EXPECT--
1.1.1.2 ! misho 26: array(12) {
! 27: ["test1bpix.bmp"]=>
! 28: array(6) {
! 29: [0]=>
! 30: int(500)
! 31: [1]=>
! 32: int(345)
! 33: [2]=>
! 34: int(6)
! 35: [3]=>
! 36: string(24) "width="500" height="345""
! 37: ["bits"]=>
! 38: int(32)
! 39: ["mime"]=>
! 40: string(14) "image/x-ms-bmp"
! 41: }
1.1 misho 42: ["test1pix.bmp"]=>
43: array(6) {
44: [0]=>
45: int(1)
46: [1]=>
47: int(1)
48: [2]=>
49: int(6)
50: [3]=>
51: string(20) "width="1" height="1""
52: ["bits"]=>
53: int(24)
54: ["mime"]=>
55: string(14) "image/x-ms-bmp"
56: }
57: ["test1pix.jp2"]=>
58: array(7) {
59: [0]=>
60: int(1)
61: [1]=>
62: int(1)
63: [2]=>
64: int(10)
65: [3]=>
66: string(20) "width="1" height="1""
67: ["bits"]=>
68: int(8)
69: ["channels"]=>
70: int(3)
71: ["mime"]=>
72: string(9) "image/jp2"
73: }
74: ["test1pix.jpc"]=>
75: array(7) {
76: [0]=>
77: int(1)
78: [1]=>
79: int(1)
80: [2]=>
81: int(9)
82: [3]=>
83: string(20) "width="1" height="1""
84: ["bits"]=>
85: int(8)
86: ["channels"]=>
87: int(3)
88: ["mime"]=>
89: string(24) "application/octet-stream"
90: }
91: ["test1pix.jpg"]=>
92: array(7) {
93: [0]=>
94: int(1)
95: [1]=>
96: int(1)
97: [2]=>
98: int(2)
99: [3]=>
100: string(20) "width="1" height="1""
101: ["bits"]=>
102: int(8)
103: ["channels"]=>
104: int(3)
105: ["mime"]=>
106: string(10) "image/jpeg"
107: }
108: ["test2pix.gif"]=>
109: array(7) {
110: [0]=>
111: int(2)
112: [1]=>
113: int(1)
114: [2]=>
115: int(1)
116: [3]=>
117: string(20) "width="2" height="1""
118: ["bits"]=>
119: int(1)
120: ["channels"]=>
121: int(3)
122: ["mime"]=>
123: string(9) "image/gif"
124: }
125: ["test4pix.gif"]=>
126: array(7) {
127: [0]=>
128: int(4)
129: [1]=>
130: int(1)
131: [2]=>
132: int(1)
133: [3]=>
134: string(20) "width="4" height="1""
135: ["bits"]=>
136: int(2)
137: ["channels"]=>
138: int(3)
139: ["mime"]=>
140: string(9) "image/gif"
141: }
142: ["test4pix.iff"]=>
143: array(6) {
144: [0]=>
145: int(4)
146: [1]=>
147: int(1)
148: [2]=>
149: int(14)
150: [3]=>
151: string(20) "width="4" height="1""
152: ["bits"]=>
153: int(4)
154: ["mime"]=>
155: string(9) "image/iff"
156: }
157: ["test4pix.png"]=>
158: array(6) {
159: [0]=>
160: int(4)
161: [1]=>
162: int(1)
163: [2]=>
164: int(3)
165: [3]=>
166: string(20) "width="4" height="1""
167: ["bits"]=>
168: int(4)
169: ["mime"]=>
170: string(9) "image/png"
171: }
172: ["test4pix.psd"]=>
173: array(5) {
174: [0]=>
175: int(4)
176: [1]=>
177: int(1)
178: [2]=>
179: int(5)
180: [3]=>
181: string(20) "width="4" height="1""
182: ["mime"]=>
183: string(9) "image/psd"
184: }
185: ["test4pix.swf"]=>
186: array(5) {
187: [0]=>
188: int(550)
189: [1]=>
190: int(400)
191: [2]=>
192: int(4)
193: [3]=>
194: string(24) "width="550" height="400""
195: ["mime"]=>
196: string(29) "application/x-shockwave-flash"
197: }
198: ["test4pix.tif"]=>
199: array(5) {
200: [0]=>
201: int(4)
202: [1]=>
203: int(1)
204: [2]=>
205: int(7)
206: [3]=>
207: string(20) "width="4" height="1""
208: ["mime"]=>
209: string(10) "image/tiff"
210: }
211: }