xref: /PHP-7.3/ext/exif/tests/bug64739.phpt (revision b746e698)
1--TEST--
2Bug #64739 (Invalid Title and Author data returned)
3--SKIPIF--
4<?php
5extension_loaded("exif") or die("skip need exif");
6if (!extension_loaded('mbstring')) die('skip mbstring extension not available');
7?>
8--FILE--
9<?php
10echo "Test\n";
11
12$headers1 = exif_read_data(__DIR__ . '/bug64739.jpg');
13
14if ($headers1 === false) {
15	echo 'Error, failed to read exif data';
16	exit;
17}
18
19var_dump($headers1['Title']{0} === '?');
20var_dump($headers1['Author']{0} === '?');
21
22ini_set('exif.decode_unicode_motorola', 'UCS-2LE');
23
24$headers2 = exif_read_data(__DIR__ . '/bug64739.jpg');
25
26if ($headers2 === false) {
27	echo 'Error, failed to read exif data';
28	exit;
29}
30
31var_dump($headers2['Title']);
32var_dump($headers2['Author']);
33
34?>
35Done
36--EXPECT--
37Test
38bool(true)
39bool(true)
40string(8) "55845364"
41string(13) "100420.000000"
42Done
43