|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40109 iptcembed fails on non-jfif jpegs
Submitted: 2007-01-12 06:44 UTC Modified: 2007-02-12 20:40 UTC
From: kb0 dot org at gmail dot com Assigned:
Status: Closed Package: *Graphics related
PHP Version: All OS: all
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
49 - 17 = ?
Subscribe to this entry?

 [2007-01-12 06:44 UTC] kb0 dot org at gmail dot com
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:

Expected result:
Image with new iptc data inserted at APP13 marker

Actual result:
Image copied, yet stripped of old iptc data


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-12 07:33 UTC] kevin dot burek at gmail dot com
Tested in newest build and problem persists.
 [2007-01-12 07:37 UTC] 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:

< 	unsigned int spool = 0, done = 0, inx, len;	
> 	unsigned int spool = 0, done = 0, written=0, inx, len;	
> 			case M_APP1:
> 				/* APP1 (EXIF) usually appears in lieu of a missing APP0 (JFIF) */ 
> 				if (written) break; /* it seems we've already written our header */
> 				written = 1;
 [2007-01-12 09:19 UTC]
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 21:58 UTC] kb0 dot org at gmail dot com
Reproduction code:
 [2007-02-12 20:40 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 16:01:28 2024 UTC