Bug #78183 [Fbk->Csd]: finfo_file shows wrong mime-type for .tga file
| From: | ab@php.net | Date: | Sat, 29 Jun 2019 11:32:45 +0000 |
| Subject: | Bug #78183 [Fbk->Csd]: finfo_file shows wrong mime-type for .tga file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-221562@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78183&edit=1
ID: 78183
Updated by: ab@php.net
Reported by: dev at jdoubleu dot de
Summary: finfo_file shows wrong mime-type for .tga file
-Status: Feedback
+Status: Closed
Type: Bug
Package: Filesystem function related
Operating System: Linux
PHP Version: 7.2.19
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of dev@jdoubleu.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=855bbc88c94bd9317379ab67e96a7bfce2f7c195
Log: Fix #78183: finfo_file shows wrong mime-type for .tga file
Previous Comments:
------------------------------------------------------------------------
[2019-06-28 13:17:21] dev at jdoubleu dot de
The following pull request has been associated:
Patch Name: Fix #78183: finfo_file shows wrong mime-type for .tga file
On GitHub: https://github.com/php/php-src/pull/4326
Patch: https://github.com/php/php-src/pull/4326.patch
------------------------------------------------------------------------
[2019-06-27 14:35:14] dev at jdoubleu dot de
I found the cause for this issue:
It has something to do with the underlying libmagic (or file) library.
This commit
(https://github.com/file/file/commit/bb421c437d406760fb9f70f49e2eb5c504528450#diff-5c8aa65000f916c2f4b5c29c808ea851)
fixes the duplicate output for tga images.
It looks like this issue does not appear in version 5.32 or later anymore.
------------------------------------------------------------------------
[2019-06-22 20:38:55] dev at jdoubleu dot de
According to git the ext-fileinfo did not change between 7.2 and 7.3 (see https://github.com/php/php-src/compare/PHP-7.2/ext/fileinfo/fileinfo.c..PHP-7.3/).
Running the script under 7.1 returns "application/octet-stream". This might be related to
https://bugs.php.net/bug.php?id=67516 (and
others).
Libmagic was updated from version 531 (PHP7.2) to 533 (PHP7.3).
------------------------------------------------------------------------
[2019-06-21 13:10:23] dev at jdoubleu dot de
I have uploaded the images to Docker Hub: https://hub.docker.com/r/jdoubleu/php-bug-78183
Running the script in Travis CI also confirms this bug: https://travis-ci.com/jdoubleu/php-bug-78183/builds/116430262#L236
------------------------------------------------------------------------
[2019-06-21 06:28:01] krakjoe@php.net
Ah, I still had this page open from yesterday, and saw your comment after I posted analysis.
I'll take another look ...
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=78183
--
Edit this bug report at https://bugs.php.net/bug.php?id=78183&edit=1