com php-src: Test case for bug #64739: ext/exif/tests/bug64739.jpg ext/exif/tests/bug64739.phpt
| From: | Kalle Sommer Nielsen | Date: | Fri, 21 Jul 2017 19:55:11 +0000 |
| Subject: | com php-src: Test case for bug #64739: ext/exif/tests/bug64739.jpg ext/exif/tests/bug64739.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-98697@lists.php.net to get a copy of this message | ||
Commit: b61339200385989fddfab53dc2673bca2f4d13c5
Author: Kalle Sommer Nielsen <kalle@php.net> Fri, 21 Jul 2017 21:55:11 +0200
Parents: 1e9e7d4dc4949b67908e55ab3f3e44528923c029
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b61339200385989fddfab53dc2673bca2f4d13c5
Log:
Test case for bug #64739
Bugs:
https://bugs.php.net/64739
Changed paths:
A ext/exif/tests/bug64739.jpg
A ext/exif/tests/bug64739.phpt
Diff:
diff --git a/ext/exif/tests/bug64739.jpg b/ext/exif/tests/bug64739.jpg
new file mode 100644
index 0000000..65273e6
Binary files /dev/null and b/ext/exif/tests/bug64739.jpg differ
diff --git a/ext/exif/tests/bug64739.phpt b/ext/exif/tests/bug64739.phpt
new file mode 100644
index 0000000..8cd29ff
--- /dev/null
+++ b/ext/exif/tests/bug64739.phpt
@@ -0,0 +1,41 @@
+--TEST--
+Bug #64739 (Invalid Title and Author data returned)
+--SKIPIF--
+<?php
+extension_loaded("exif") or die("skip need exif");
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+$headers1 = exif_read_data(__DIR__ . '/bug64739.jpg');
+
+if ($headers1 === false) {
+ echo 'Error, failed to read exif data';
+ exit;
+}
+
+var_dump($headers1['Title']{0} === '?');
+var_dump($headers1['Author']{0} === '?');
+
+ini_set('exif.decode_unicode_motorola', 'UCS-2LE');
+
+$headers2 = exif_read_data(__DIR__ . '/bug64739.jpg');
+
+if ($headers2 === false) {
+ echo 'Error, failed to read exif data';
+ exit;
+}
+
+var_dump($headers2['Title']);
+var_dump($headers2['Author']);
+
+?>
+Done
+--EXPECTF--
+Test
+bool(true)
+bool(true)
+string(8) "55845364"
+string(13) "100420.000000"
+Done
\ No newline at end of file