php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #61024 IPTC tags limited to 64 chars
Submitted: 2012-02-09 09:16 UTC Modified: 2020-06-23 10:11 UTC
Votes:3
Avg. Score:4.0 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: opajaap at opajaap dot nl Assigned: cmb (profile)
Status: Not a bug Package: GetImageSize related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2012-02-09 09:16 UTC] opajaap at opajaap dot nl
Description:
------------
---
From manual page: http://www.php.net/function.iptcparse#refsect1-function.iptcparse-description
---

The code example below returns values in $desc truncated to 64 chars.
We would like to see that the full strings are returned.




Test script:
---------------
	$attr = getimagesize($file, $info);
	$iptc = iptcparse($info['APP13']);

	foreach (array_keys($iptc) as $s) {
		if ( is_array($iptc[$s]) ) {
			$c = count ($iptc[$s]);
			for ($i=0; $i <$c; $i++) {
				$desc 	= $iptc[$s][$i];
				echo $desc.'<br />';
			}
		}
	}



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-07-17 12:05 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2015-07-17 12:05 UTC] cmb@php.net
I can't reproduce the truncation of IPTC fields to 64 characters.
Please provide a link to an image where this issue can be
reproduced.
 [2015-07-17 12:51 UTC] opajaap at opajaap dot nl
-Status: Feedback +Status: Closed
 [2015-07-17 12:51 UTC] opajaap at opajaap dot nl
I can also no longer repreoduce this problem. Call closed.
 [2020-06-23 08:54 UTC] opajaap at opajaap dot nl
I want to re-open this request.

Here is a link to an image that shows the issue for iptc tag 2#025
https://betatest.opajaap.nl/wp-content/uploads/wppa-source/album-38/M.50.jpg
'Mandela family, apartheid, children, domestic lifer, politics, r' is truncated to 64 chars

Here one for tag 2#92
https://betatest.opajaap.nl/wp-content/uploads/wppa-source/album-38/M.50.jpg
'Soweto, Johannesburg, Gauteng So' is truncated to 32 chars:
 [2020-06-23 10:11 UTC] cmb@php.net
-Status: Closed +Status: Not a bug
 [2020-06-23 10:11 UTC] cmb@php.net
This information is actually truncated in the IPTC APP13 segment;
there is complete info in the XMP APP1 segment, but parsing XMP
metadata is not supported.  Also note that the XMP APP1 segment is
the second APP1 segment in that image file, but getimagesize()
only ever reports the first APPn segment.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 11:01:30 2024 UTC