|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-09-05 09:45 UTC] zws at ahtvu dot ah dot cn
Description: ------------ I found a problem when php recongize a jpg file.This file can be rendered by acdsee,ie,firefox,etc,but getimagesize function returns false. Your can download the file from url http://bm.ahtvu.ah.cn/img/20163/a/6/5177/org_faceimg.jpg. This file have a lot of zeros between jpg data sections,I check php source code and find that php_next_marker function can not cope with it. I give the following patch which I can not ensure ok under any circumstances. [root@cache84 standard]# diff image.c patch_image.c 416c416 < } while (marker == 0xff); --- > } while (marker == 0xff || marker == 0); Test script: --------------- <?php var_dump(getimagesize('/root/f.jpg')); PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Hello,I chekout last version of php,and test the relate code,the result is ok,thanks. [root@node5 bin]# ./php -v PHP 7.2.0-dev (cli) (built: Sep 6 2016 09:18:22) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies [root@node5 bin]# ./php ~/zws.php Warning: getimagesize(): corrupt JPEG data: 888 extraneous bytes before marker in /root/zws.php on line 3 array(7) { [0]=> int(120) [1]=> int(160) [2]=> int(2) [3]=> string(24) "width="120" height="160"" ["bits"]=> int(8) ["channels"]=> int(3) ["mime"]=> string(10) "image/jpeg" }