#40109 [Opn->Csd]: iptcembed fails on non-jfif jpegs
| From: | tony2001@php.net | Date: | Mon, 12 Feb 2007 20:40:33 +0000 |
| Subject: | #40109 [Opn->Csd]: iptcembed fails on non-jfif jpegs | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-108757@lists.php.net to get a copy of this message | ||
ID: 40109
Updated by: tony2001@php.net
Reported By: kb0 dot org at gmail dot com
-Status: Open
+Status: Closed
Bug Type: *Graphics related
Operating System: all
PHP Version: All
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2007-01-12 21:58:55] kb0 dot org at gmail dot com
Reproduction code:
http://photos.kb0.org/php/bug40109.php
http://photos.kb0.org/php/bug40109.phps
------------------------------------------------------------------------
[2007-01-12 09:19:07] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
------------------------------------------------------------------------
[2007-01-12 07:37:02] kevin dot burek at gmail dot com
here's a diff for 5.2.0 that should patch many of the cases that this
bug manifests:
183c183
< unsigned int spool = 0, done = 0, inx, len;
---
> unsigned int spool = 0, done = 0, written=0, inx, len;
266a267,268
> case M_APP1:
> /* APP1 (EXIF) usually appears in lieu of a missing APP0 (JFIF)
*/
268a271
> if (written) break; /* it seems we've already written our header
*/
281a285
> written = 1;
------------------------------------------------------------------------
[2007-01-12 07:33:02] kevin dot burek at gmail dot com
Tested in newest build and problem persists.
------------------------------------------------------------------------
[2007-01-12 06:44:15] kb0 dot org at gmail dot com
Description:
------------
The poorly documented iptcembed function fails to insert a header (and
throws no errors) when a jpeg lacks the APP0 marker. The code in
iptc.c is currently written to insert the new APP13 section immediately
after the APP0 section. When this is missing, the function falls
straight through.
Reproduce code:
---------------
http://www.php.net/manual/en/function.iptcembed.php#18549
Expected result:
----------------
Image with new iptc data inserted at APP13 marker
Actual result:
--------------
Image copied, yet stripped of old iptc data
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40109&edit=1