|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-07-18 19:06 UTC] cmb@php.net
-Assigned To:
+Assigned To: cmb
[2015-07-18 19:42 UTC] cmb@php.net
-Status: Assigned
+Status: Analyzed
[2015-07-18 19:42 UTC] cmb@php.net
[2015-07-18 20:58 UTC] cmb@php.net
[2015-07-18 20:58 UTC] cmb@php.net
-Status: Analyzed
+Status: Closed
[2015-07-21 14:20 UTC] ab@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 20:00:01 2025 UTC |
Description: ------------ Repeately calling iptcembed() causes a superfluous FF byte to be added with each call. While this may not be a violation of the JFIF standard (the specs are not publicly available, apparently), I'd nonetheless consider this a bug, because repeated embedding of the same metadata should not result in different files. Test script: --------------- <?php $filename = __DIR__ . '/test.jpg'; @unlink($filename); $im = imagecreatetruecolor(10, 10); imagejpeg($im, $filename); imagedestroy($im); $data = "\x1C\x02x\x00\x0ATest image" . "\x1C\x02t\x00\x22Copyright 2008-2009, The PHP Group"; $content = iptcembed($data, $filename); $fp = fopen($filename, "wb"); fwrite($fp, $content); fclose($fp); echo filesize($filename), PHP_EOL; clearstatcache(); $content = iptcembed($data, $filename); $fp = fopen($filename, "wb"); fwrite($fp, $content); fclose($fp); echo filesize($filename), PHP_EOL; ?> Expected result: ---------------- 779 779 Actual result: -------------- 779 780